Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

[RESOLVED] Drag a button on a form

$
0
0
I just want to move a button on a form at run time. When I do a mousedown and drag the button I get an outline of the button. But when I do a mouseup the outline disapears and nothing happens. So where am I going wrong? Thanks.

Code:

Private Sub btnbutton_MouseDown(Index As Integer, Button As Integer, Shift As Integer, leftpos As Single, toppos As Single)
btnbutton(Index).Drag vbBeginDrag
End Sub

Private Sub btnbutton_MouseUp(Index As Integer, Button As Integer, Shift As Integer, leftpos As Single, toppos As Single)
btnbutton(Index).Left = leftpos
btnbutton(Index).Top = toppos
btnbutton(Index).Drag vbEndDrag
End Sub


Viewing all articles
Browse latest Browse all 21090

Trending Articles