How to make flashing/blinking text.

Posts 1–4 of 4 · Page 1 of 1
How to make flashing/blinking text.
ok well this prolly isnt very useful, but its nice to know.

ok what you need is:

a timer
a form
a label

what to do:

make a windows form and put a label anywhere and put whatever text you like and whatever color you like.

drag a Timer onto you form.Then double click the Timer1 and under the tick even put:
Code:
Timer1.Interval = (1000)  //1 second 
Me.Label1.Visible = Not Me.Label1.Visible
now create a form load event like this:
Code:
Private Sub Main_Frm_Load(ByVal sender As System.Object, ByVal _
        e As System.EventArgs) Handles MyBase.Load
change Main_Frm_Load to whatever the name of you form is ( proll form1 so change it to Form1_Load) ( Main_Frm is the name of my form.)

now under the load event put in:
Code:
Timer1.enabled = True
now if you want the texts to blink after pushing a button

under the form load event change from Timer1.enabled = True to Timer1.enabled = False -like this:

Code:
Private Sub Main_Frm_Load(ByVal sender As System.Object, ByVal _
        e As System.EventArgs) Handles MyBase.Load

Timer1.enabled = False

end sub

then add a button to your windows form and double click it.
Under the button click event put:

Code:
Timer1.enabled = True
and there you go! you should now be able to code a blinking/Flashing text in VB!! Hope i helped

btw i did this in vb2008 and vb2010
Pretty simple but very good your the beginners!

I think this is easier!

Add 2timers
1 label

Add this to form load!
Code:
Timer1.interval = 100
timer2.interval = 200
timer1.enabled = true
timer2.enabled = true
Add this code to timer1:

Code:
label1.hide()

add this code to timer2:
Code:
label1.show()
Nice, thanks for the Info. Comes in handy for people like ME in the process of Learning programming.

Much Thanks
Quote Originally Posted by Zoom View Post
Pretty simple but very good your the beginners!

I think this is easier!

Add 2timers
1 label

Add this to form load!
Code:
Timer1.interval = 100
timer2.interval = 200
timer1.enabled = true
timer2.enabled = true
Add this code to timer1:

Code:
label1.hide()

add this code to timer2:
Code:
label1.show()
that's really not that much easier lol same basic thing....but i guess the Me.Label1.Visible = Not Me.Label1.Visible


would be a lil harder to remember for the beginners.
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?