473,396 Members | 1,866 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,396 software developers and data experts.

Blinking button

i wish to make the button blinking for 5 times at 1 second interval.

how come i cannot see the blinking effect?

is there any screen update function? Thanks.

******************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If Button1.BackColor = Color.Red Then
Dim a
For a = 1 To 5
Button1.BackColor = Color.Yellow
System.Threading.Thread.Sleep(1000)
Button1.BackColor = Color.Red
Next
Else
Button1.BackColor = Color.Red
End If
End Sub
Nov 18 '06 #1
2 9160
Add

Application.DoEvents()

after your sleep line.
__________________________________________
The Grim Reaper

"tony wong" <x3*@netvigator.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>i wish to make the button blinking for 5 times at 1 second interval.

how come i cannot see the blinking effect?

is there any screen update function? Thanks.

******************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If Button1.BackColor = Color.Red Then
Dim a
For a = 1 To 5
Button1.BackColor = Color.Yellow
System.Threading.Thread.Sleep(1000)
Button1.BackColor = Color.Red
Next
Else
Button1.BackColor = Color.Red
End If
End Sub


Nov 18 '06 #2
Thanks a lot.
"The Grim Reaper" <gr*********@REMOVEbtopenworld.com¼¶¼g©ó¶l¥ó·s»D:x J********************@bt.com...
Add

Application.DoEvents()

after your sleep line.
__________________________________________
The Grim Reaper

"tony wong" <x3*@netvigator.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>i wish to make the button blinking for 5 times at 1 second interval.

how come i cannot see the blinking effect?

is there any screen update function? Thanks.

******************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If Button1.BackColor = Color.Red Then
Dim a
For a = 1 To 5
Button1.BackColor = Color.Yellow
System.Threading.Thread.Sleep(1000)
Button1.BackColor = Color.Red
Next
Else
Button1.BackColor = Color.Red
End If
End Sub



Nov 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hugo | last post by:
I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink. What...
1
by: _andrea.l | last post by:
I'd like to make a blinking button: how can I do? Thank you in advance, Andrea.
5
by: Markus | last post by:
Blinking control Perhaps my question is not exactly an Access question, but may somebody might give me an answer.i have a very important control on my report, called "Stockflow" and in case...
2
by: Sharon | last post by:
The ErrorProvider text is also blinking together with the icon. It’s making the reading of the error description very uncomfortable. Is there a way to prevent the text from blinking while the...
1
by: Sharon | last post by:
The ErrorProvider text is also blinking together with the icon. It’s making the reading of the error description very uncomfortable. Is there a way to prevent the text from blinking while the...
4
by: Lam | last post by:
Hi I try to make the text showm in the asp:Label to have some dynamic effect such as blinking, scrolling. Does any one know how to do that? Thank
2
by: Ling | last post by:
Hi, I guessed this is a weird question but it really bothers me. I created a web page w/ asp.net, have a menu on the top and a listbox right below it. When I try to navigate the menu, the...
3
by: fbergroth | last post by:
Hi, I'm quite new to C# allthough I've been programming in other languages for quite a while. I'd like to change the blinking cursor inside a TextBox, I guess I must derive the class and...
5
by: michels287 | last post by:
Right now I have a touchscreen with a virual keyboard. I would like to create arrow keys. If the user messed up the inputted text, he can move the blinking cursor left one space at a time between...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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,...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.