.gobump img{ border: 5px solid #ccc; float: left; margin: 15px; -webkit-transition: margin 0.5s ease-out; -moz-transition: margin 0.5s ease-out; -o-transition: margin 0.5s ease-out; border-radius: 5px 5px 5px 5px; } .gobump img:hover { margin-top: 2px; }

twitter

Friday, March 13, 2009

Make a Timer in Visual Basic

A timer in Visual Basic will permit the developer to have a predetermined activity happen on his operating system after a certain period in time. The developer determines what the activity is and what time period will be. Follow these steps to create a timer in Visual Basic.


Step1
Open up your Visual Basic program. Make one button. Enter this code under the button_click sub: MsgBox ("HELLO I'M A MSG BOX PROMPT").
Step2
Double click on the icon of the clock that is located on the left hand side of the screen.
Step3
Disable the timer so that it does not do something without being programmed with what to do. On the first line type "Private Sub Form_Load()" then on the second line type "Timer1.Enabled = False" On the third line type "End Sub."
Step4
Program the timer to do something. On the first line type "Private Sub Command1_Click()" then on the second line type "Timer1.Enabled = True" On the third line type "End Sub."
Step5
Enter some code to stop the timer from endlessly repeating itself. On the first line type "Private Sub Timer1_Timer()." On the second line type "MsgBox (HELLO I'M A MESSAGE BOX PROMPT")." On the third line type "Timer1.Enabled = False" and on the fourth line type "End Sub."

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 

Categories