i will update this thread if u can post too.:thumb::):p
Move Controls at Runtime
Code:
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Command1.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub
Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Command2.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Text1.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub
Private Sub Text2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Text2.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub