Sunday, November 6, 2011

Menggerakan Form tanpa Border

Untuk menggerakkan Form yang sengaja tidak diberi border (BorderStyle=None) dan ketikkan kode berikut di bagian '(Declarations)'-nya

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 Long) As Long

Selanjutnya, di bagian 'Form_MouseDown' ketikkan :

If Button = 1 Then 'left click
ReleaseCapture
SendMessage Me.hWnd, &HA1, 2, 0
End If

Selamat Mencoba...

No comments:

Post a Comment