473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using a time delay to make a label flash colours

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
2 7566
j1808
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
Killer42
8,435 Expert 8TB
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
10
by: AmitTrehan | last post by:
hi friends, I want to know how can we insert delay in vb.net like..... i want to show two strings on same label first one string then break of 5 secs and then second string how can i acheive...
1
by: WannaBeProgrammer | last post by:
is there a simple way to code a timer to make a warning label blink on and off? Lets say I have a form with 3 textboxes and 4 labels plus one timer object(labelTimer)and 2...
52
by: mavic | last post by:
hi to everybody,i need help for my project....how to make a program that accept any integer and convert it binary,octal and hexadecimal.pls help me...thanks
14
by: Steve Teeples | last post by:
I don't understand why I cannot use a property to modify data within a struct. Can someone tell me why I get the error "Cannot modify the return value of "myData.TheData" because it is not a...
9
by: piyush2884 | last post by:
hi guys, got anything on this issue?
23
by: mosesdinakaran | last post by:
Hi All, I need a small clarification in submitting the forms, Ur suggestions please. In a page I have two form and also two submit butons. (ie)
10
by: Martin Hughes | last post by:
Hi guys, I was wondering if anyone could give me some advice. I am looking to develop an ASP.NET application that will enable several workstations to access real time telemetry data received...
7
by: emlimeng | last post by:
Hello, I have a label on the form to draw people's attention so they do not forget to input the data in a particular section. e.g. "Please carefully check all the options on the form". I hope I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.