Flashing things tend to catch the eye. This makes flashing an effective way to emphasize interface elements in a program. In Visual Basic 6, a programming language for Windows, most controls have a Visible property that determines whether the control is drawn on the screen. It is fairly easy to make a control appear to flash by turning its Visible property on and off.
Add the control that you want to make flash to your VB6 project. If you want a flashing stop sign, for example, add an Image control with a picture of a stop sign. If you want a button to flash, add the button.
Add a timer control to the project. The timer control is shown on your form, but will not be visible at run time.
Set the timer's Interval property. The interval property specifies how many milliseconds to wait between timer events. For example, if you want to make something flash off and then on every second, set the interval to 500.
Add code to the Timer event that toggles the control's visible property:
Image1.Visible = Not Image1.Visible
Because of the Not keyword, this code sets the control's Visible property to true if it is false, and to false if it is true.
Enable the timer to make the control start flashing:
Timer1.Enabled = True
Disable the timer to make the control stop flashing:
Timer1.Enabled = False
Image1.Visible = False
- "Microsoft Visual Basic 6.0 Language Reference"; Maureen Williams Zimmerman; 1998
- VB6.us: "Understanding the timer control"; The VB Programmer, LLC; 2011
- Photo Credit Jupiterimages/Comstock/Getty Images
How to Make Animations in Visual Basic 6.0
VB 6.0 is one of the most used development languages for developers. VB is often used to create graphical user interface applications...
How to Create a Function Button in Visual Basic
As Visual Basic is a main driver of web programming technology, it makes sense to figure out the basics of the language....
Fun Things to Make With Visual Basic
Microsoft's Visual Basic offers a great way to learn Windows programming. Its full-featured Integrated Development Environment (IDE) includes an easy to use,...
How to Make a Calculator With Visual Basic
Microsoft Visual Basic is a programming language based on the BASIC language, originally developed to make programming easier to learn. Visual Basic...
How to Make a Video Countdown Timer for Mac
There are several ways to create a video countdown timer on a Mac. Unfortunately, none are free. This tutorial will use Countdown...
How to Make a Visual Basic Game
Microsoft Visual Basic is a basic programming language, ideal for those just learning to program. The learning curve on Visual Basic is...
How to Make a Splash Screen in VB.NET
Making a splash screen with Visual Studio.Net using the VB development language can be done with the built-in splash screen template and...