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

Blinking Text

P: 4
Hi I am Pankaj. I need help in displaying blinking text on a label or in a text box.I have just started learning Visual Basic.Please help
Thanks
Pankaj
Sep 6 '07 #1
Share this Question
Share on Google+
6 Replies


hariharanmca
100+
P: 1,977
Hi I am Pankaj. I need help in displaying blinking text on a label or in a text box.I have just started learning Visual Basic.Please help
Thanks
Pankaj
You can use Timer Control and change the intervel according to the speed
Sep 6 '07 #2

Robbie
100+
P: 180
As Hari said, a timer's your best bet, but since you're new to VB, I'll explain a little more...
Add a timer to your form. Set its Interval to something around 250 (this is in milliseconds). In other words, make this number lower to make the text flash faster.

Pretending that the label which you want to flash on/off is called Label1, in the timer's main event (i.e. when you double-click on it), type this:

Label1.Visible = Not Label1.Visible

That will swap it's Visible property between True and False every time it comes to that line.

EDIT: Make sure the timer's Enabled property is set to True! (You can change it to False to stop the text flashing - just remember to set Label1.Visible back to True, in case it stops when it's invisible.)
Sep 6 '07 #3

hariharanmca
100+
P: 1,977
As Hari said, a timer's your best bet, but since you're new to VB, I'll explain a little more...
Thank Robbie (Do not have time to explain more).
Sep 7 '07 #4

Expert 5K+
P: 8,434
As Hari said, a timer's your best bet, but since you're new to VB, I'll explain a little more...
Thanks Robbie.

One handy technique I like to use in a case like this is to take advantage of the .Tag property to identify labels (or other controls) to blink. The idea is, each time your timer fires, loop through all the controls on the form. Check their Tag property and if you see a particular value in there, then switch the visibility (or background colour, or whatever you choose) of that control.
Sep 8 '07 #5

Robbie
100+
P: 180
Thanks Robbie.

One handy technique I like to use in a case like this is to take advantage of the .Tag property to identify labels (or other controls) to blink. The idea is, each time your timer fires, loop through all the controls on the form. Check their Tag property and if you see a particular value in there, then switch the visibility (or background colour, or whatever you choose) of that control.
Hey, that's a great idea!
I have to use that technique for something now (not for flashing text, but for something which needs to be done for many controls but I don't want to hard-code for every single one).
Sep 8 '07 #6

Ali Rizwan
100+
P: 927
Hi I am Pankaj. I need help in displaying blinking text on a label or in a text box.I have just started learning Visual Basic.Please help
Thanks
Pankaj
Hi Pankaj
Check this thing and feed me back.
Here is a url where I have attached a file. Download it and try to modify as your needs
Blinking text
Sep 8 '07 #7

Post your reply

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