Tuesday, October 6, 2009

Microsoft Visual Basic automatic button press.?

In Microsoft Visual Basic, how do you make a button seem as if it has been pressed. Like every 10 seconds the program presses the "f" button. How do you do that?



Microsoft Visual Basic automatic button press.?antivirus download



Write an OnClick event for your button, and put whatever you want to run when the button is pressed. Then use a Timer component, set the Interval property to 10,000 (it's in milisecond) and write an OnTimer event where you call the button's OnClick procedure from it.



Microsoft Visual Basic automatic button press.?bmw



In VB .NET, you use a timer control, this is located on the standard toolbar that lies to the left of the screen.



Then I think you would create this procedure:



Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick



'this code will call the command button procedure



button1_click(sender, e)



End Sub



Like people said up above, you must set the interval of the timer and call the start method of the instance of the timer object that you create. So something like this:



timer1.start



I think you put that code into the timer_tick procedure. This is how it is done with VB .NET I think people up above are explaining it how it would be accomplished with Visual Basic 6.

No comments:

Post a Comment