How to make a blinking button in VB

Written by stephen byron cooper Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to make a blinking button in VB
Create your VB blinking button in the Visual Studio programming environment. (Microsoft Corporation)

Creating a blinking button in Visual Basic means adding a timer to your form. The blinking properties of the button are built into the timer, not the button itself. Including a timer in a form raises the possibility of using the timer to introduce other time-based functions to your VB program.

Skill level:

Other People Are Reading



  1. 1

    Add a button to your form. Drag a button object from the palette on the left hand side of the studio. If this is the first button on your form it will be called “Button1” by default.

  2. 2

    Look down the Properties panel on the right of the screen. Find the “Text” property. This is the label that appears on your button. Change the button text to “Flashing” and click out of the field to automatically save the change.

  3. 3

    Resize the button to make it bigger. For this exercise the button will be the only object on the form, so you might as well make it a significant size. You can also move the button to the centre of the form.


  1. 1

    Drag a timer onto the studio from the palette on the left of the screen. It will be called “Timer1” by default.

  2. 2

    Position the timer anywhere on the screen. It doesn’t have to be on the form or on the button.

  3. 3

    Look through the properties of the timer. Find the “Interval” property and change its value to 50. Find the “Enabled” property and change this to “True” to make the timer active.

  4. 4

    Add code to the Timer 1 “Tick” event. The code should read: Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer1.Tick If Button1.Text = “Flashing” Then Button1.Text = “” ElseIf Button1.Text = “” Then Button1.Text = “Flashing” End If End Sub

  5. 5

    Run the code by pressing the play button in the top menu bar. You will see the button appear with the text “Flashing” blinking on and off.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.