By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

Using a time delay to make a label flash colours

P: 2
hi there, so yes, im am trying to make my label flash diffrent colours, so when i have enterd a value in some textbox which does not meet my parameter, (i.e runs the ELSE in an IF..)
it runs this code so it flashes the label red -->white --> red --> white

so it simply flash'es the code.

my code is

Expand|Select|Wrap|Line Numbers
  1. MsgBox("flashing --> start") 'test1
  2.             lblSnK.ForeColor = Color.Red
  3.             System.Threading.Thread.Sleep(10000)  'pauses the running
  4.             lblSnK.ForeColor = Color.White
  5.             System.Threading.Thread.Sleep(10000)
  6.             lblSnK.ForeColor = Color.Red
  7.             System.Threading.Thread.Sleep(10000)
  8.             lblSnK.ForeColor = Color.White
  9.             MsgBox("flashing --> stop")   'test2  
but this does not do anoything, does not change the colour of the label..

the code
Expand|Select|Wrap|Line Numbers
  1.  lblSnK.ForeColor = Color.Red
works ok on the labell

and the procedure runs ok becuase i get both msg boxes test1 and test2




any advice on how i could do this ?? (vb.net 2005)

thanks for any help/advise

regards, j

EDIT: should this be posted in .NET programming ? (soz, new here :) )
Feb 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: 2
hi there, so yes, im am trying to make my label flash diffrent colours, so when i have enterd a value in some textbox which does not meet my parameter, (i.e runs the ELSE in an IF..)
it runs this code so it flashes the label red -->white --> red --> white

so it simply flash'es the code.

my code is

Expand|Select|Wrap|Line Numbers
  1. MsgBox("flashing --> start") 'test1
  2.             lblSnK.ForeColor = Color.Red
  3.             System.Threading.Thread.Sleep(10000)  'pauses the running
  4.             lblSnK.ForeColor = Color.White
  5.             System.Threading.Thread.Sleep(10000)
  6.             lblSnK.ForeColor = Color.Red
  7.             System.Threading.Thread.Sleep(10000)
  8.             lblSnK.ForeColor = Color.White
  9.             MsgBox("flashing --> stop")   'test2  
but this does not do anoything, does not change the colour of the label..

the code
Expand|Select|Wrap|Line Numbers
  1.  lblSnK.ForeColor = Color.Red
works ok on the labell

and the procedure runs ok becuase i get both msg boxes test1 and test2




any advice on how i could do this ?? (vb.net 2005)

thanks for any help/advise

regards, j

EDIT: should this be posted in .NET programming ? (soz, new here :) )
sorry, i cant close this, i got the answer, i wasn't refreshing the form, sorry.
Feb 23 '07 #2

Expert 5K+
P: 8,434
sorry, i cant close this, i got the answer, i wasn't refreshing the form, sorry.
I'll close the thread for you.

If you have a question about VB.Net I suppose it's always a bit hard to decide whether to post it in the VB or .Net forum. You could try posting in both. If anyone complains, tell them you were advised to do it - then they can come and beat me up. :)
Feb 24 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.