Dancing Command Button

Dancing Command Button

Create a Form.
Place a Command Button and Timer control.
Place the code in the timer control and Run it.
The command button will be dancing

Private Sub Timer1_Timer()
Static i As Single
If i > 4 Then i = 0
Select Case i
Case 1:
Command1.Left = Command1.Left + 30
Case 2:
Command1.Top = Command1.Top + 30
Case 3:
Command1.Left = Command1.Left - 30
Case 4:
Command1.Top = Command1.Top - 30
End Select
i = i + 1
End Sub

You might also like...

Comments

 mailto:gopi@gopi2000.com

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski