PC Review


Reply
Thread Tools Rate Thread

Concurrent routines

 
 
=?Utf-8?B?QW1qYWQ=?=
Guest
Posts: n/a
 
      21st Feb 2004
I want to make Label constantly blinks every time another routine is performed. Can you tell me how?
 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      21st Feb 2004
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" <(E-Mail Removed)> schreef in bericht
news:67069619-6560-4F79-8377-(E-Mail Removed)...
> I want to make Label constantly blinks every time another routine is

performed. Can you tell me how?


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      21st Feb 2004
* "=?Utf-8?B?QW1qYWQ=?=" <(E-Mail Removed)> scripsit:
> 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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
=?Utf-8?B?QW1qYWQ=?=
Guest
Posts: n/a
 
      23rd Feb 2004
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
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      23rd Feb 2004
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) ?
>
> Any other ideas?
>
> Amjad



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup routines John in Wembley Microsoft Excel Programming 1 17th Nov 2007 09:03 AM
Run routines in the IDE AGP Microsoft VB .NET 3 13th Nov 2007 08:09 AM
VBA - sub routines Help please Richard Wrigley Microsoft Excel New Users 3 23rd Nov 2006 03:06 AM
VBA routines - help please Richard Wrigley Microsoft Excel Misc 1 22nd Nov 2006 07:15 PM
if/then routines? RickyDee Microsoft Excel Worksheet Functions 2 28th Nov 2003 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:26 AM.