Information générale
Catégorie:
Fonctions Windows API
>>I want to hide titlebar.
>>And, I want to move form by mouse.
>>How can I move form not use titlebar?
>Use a form mousemove to set left and top for the form
Im form, It's possable.
But, I want to move form by mouse drag other point over the form.
In VB,
=============================================
Start a new Standard EXE project. Form1 is added by default.
Set Form1's ControlBox, MinButton, and MaxButton properties to False, and then
clear its Caption.
Place a CommandButton control (Command1) on Form1.
Place the following code in the General Declarations section of Form1:
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
Private Declare Sub ReleaseCapture Lib "User32" ()
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Private Sub Form_Load()
Command1.Caption = "Exit"
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim lngReturnValue As Long
If Button = 1 Then
Call ReleaseCapture
lngReturnValue = SendMessage(Form1.hWnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
End Sub
Private Sub Command1_Click()
End
End Sub
=============================================
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement