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

blinking textbox in vb

P: 3
hi ineed your help on creating a blinking textbox or label that changes color may be from blue to red.thanx waitin for your response.
Apr 25 '08 #1
Share this Question
Share on Google+
2 Replies


jamesd0142
100+
P: 469
Try using a timer and use code such as...

timer interval = 2000
textbox1.backcolour = red
system.threading.thread.sleep(1000)
textbox1.backcolour = green
system.threading.thread.sleep(1000)

or
timer interval = 1000
if textbox1.backcolour = red then
textbox1.backcolour = blue
else
textbox1.backcolour = red
end if
Apr 25 '08 #2

smartchap
100+
P: 236
Try this:

Private Sub Form_Load()
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
'set interval=500 or 1000 as per ur requirement.
If Text1.BackColor = vbBlue Then
Text1.BackColor = vbRed
Else
Text1.BackColor = vbBlue
End If

End Sub
Apr 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.