CodeItBetter Programming Another VB Programming Blog

How to Move objects on a form at run time.

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
'Forms - How to Move objects on a form at run time.
'Insert a text box and a command button on a form

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyRight Then  'right arrow
        Command1.Left = Command1.Left + 100
    End If
End Sub
 
'Use this code to move object around for example, a pong game
Filed under: Forms Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.