473,800 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a time delay to make a label flash colours

2 New Member
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 7603
j1808
2 New Member
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 Recognized Expert Expert
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
3811
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 counter functionality and read/insert some data in a MS Access database on that Windows 2003 server. The weird part is, as long as the web page is very short in size, I can hit the refresh button and Internet Explorer will reload the page and display...
10
93999
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 this? i mean label should show first label.text("before") then it should wait for 5 secs and then it should show label.text("After")
1
2062
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 buttons(start,stop).labels 1,2 and 3 are attached to textboxes 1,2 and 3. label 4 is stand alone and needs to bink a warning while calculations are being made(startButton click to stopButton click).The interval should be 1/2 sec. for instance: "Calculating Results"...
52
4143
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
3290
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 variable. Here is what breaks. struct Data { public Data(){} private int someData;
9
2180
by: piyush2884 | last post by:
hi guys, got anything on this issue?
23
3234
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
3091
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 from a vehicle on a track. The data flow would be as follows: |-- Workstation 1
7
7420
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 can automate the colour of the label, so that the colours for the label can keep on changing nicely and smoothly from one end to the other. Such as the colours moves per letter or per word from left to right towards the end of the sentence, or from a...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10504
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.