หน้าเว็บ

วันพุธที่ 8 มิถุนายน พ.ศ. 2554

Form Moving [ VB6 ]


Private XX As Integer
Private YY As Integer
Dim MoveMe As Boolean

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveMe = True
XX = X
YY = Y
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MoveMe = True Then
Me.Left = Me.Left + (X - XX)
Me.Top = Me.Top + (Y - YY)
End If
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Left = Me.Left + (X - XX)
Me.Top = Me.Top + (Y - YY)
MoveMe = False
End Sub

ไม่มีความคิดเห็น:

แสดงความคิดเห็น