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 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
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.)
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.
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).
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
Comment