How-To... - Create A Flashing Logo

Creating a flashing logo can make your program look more attractive. I can be used as a nag for the user to register the piece of software. You could use a flashing logo for lots of things. To make a Flashing logo(or any VB control), you need to use a Timer Control. You also need a Image Control, or Label, or whatever you wish to flash.

To follow this tutorial, create a new form, and design it like opposite. You can put an image, or any other control if you wish. The code is quite similar.

First of all, click on the Timer, and bring up the Properties box by pressing F4. Next, change the Interval to 500(1/4 of a second).

Now, double click the Timer to bring up the code window. You should be in the Timer1_Timer procedure. In this procedure, type the following code. The label in this example lblLogo - if you have a different name, change each reference to lblLogo to suit the name of your control :-

lblLogo.Visible = Not (lblLogo.Visible)

Run the project. You should now see your logo flashing each time after 1/2 a second. This code is very fast, much faster than the previous If..Else..EndIf statement.

If anything didn't make sense, you can download the Project File for this tip by clicking here

-----------

Thanks to EZTuck for the new, improved code.


This site is Copyright © 1999 of David Cowan. VB How-To, Dodgesoft and DodgeSoft Productions is Copyright © 1999 of David Cowan. Source-code and programs are copyright of their respective owners. For a messageboard, click here