Concurrent routines

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to make Label constantly blinks every time another routine is performed. Can you tell me how?
 
Hi Amjad,

I think the best to do that is using a system.windows.form.timer
(You can drag that from the standard toolbox)

When you start your procedure you enable it.
And at the end you disable it.

Then in the event from that timer you do something as
\\\
If Label1.ForeColor.ToString = Color.Red.ToString Then
Label1.ForeColor = Color.Black
Label1.BackColor = Color.Red
Else
Label1.ForeColor = Color.Red
Label1.BackColor = Color.Black
End If
///
I hope this helps?

Cor






Amjad said:
I want to make Label constantly blinks every time another routine is
performed. Can you tell me how?
 
* "=?Utf-8?B?QW1qYWQ=?= said:
I want to make Label constantly blinks every time another routine is performed. Can you tell me how?

You can place a timer control ('System.Windows.Forms.Timer') on your
form. Set its interval property and add appropriate code for the "blinking"
label to its 'Tick' event handler. Then enable the timer before caling
the procedure and disable it after it finishes.
 
Hi Cor
Thanks for your reply
I tried doing the code you suggested and it didn't work as I would like to be
The Label doesn't blink until the procedure finishes its calculations, although the timer was enabled at the beginning of the procedure
It seems to me that the Tick event is not fired when the form is busy doing something else
I guess I can re-phrase my question as: How can I run two loops at the same time (concurrent, not nested loops)

Any other ideas

Amjad
 
Hi Amjad,

The answer is simple,

Put somewhere in that procedure
application.doevents

If it is a one sentence procedure, you should have to make an extra thread
wherein you put that procedure. The timer should stay on the form because
you cannot get easy on a windowform from a thread.

But that is a lot of work for a blinking label.

I hope this helps?

Cor

"> Hi Cor,
Thanks for your reply.
I tried doing the code you suggested and it didn't work as I would like to be.
The Label doesn't blink until the procedure finishes its calculations,
although the timer was enabled at the beginning of the procedure.
It seems to me that the Tick event is not fired when the form is busy doing something else!
I guess I can re-phrase my question as: How can I run two loops at the
same time (concurrent, not nested loops) ?
 
Back
Top