VB中怎样让整个窗口都能拖动
6个回答
展开全部
只要是有框的窗体都可以拖动啊。
只要不是最大化,直接调整 Form.Left 和, Form。TOP 就行了啊
只要不是最大化,直接调整 Form.Left 和, Form。TOP 就行了啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一,直接用鼠标拖。(生成后的程序程序窗口)。 二,拖不了,(生成前的程序窗口)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ReturnVal As Long
X = ReleaseCapture()
ReturnVal = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub
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
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ReturnVal As Long
X = ReleaseCapture()
ReturnVal = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
窗口能拖动这是本来就可以的啊SB
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你是说想通过拖动控件让窗体移动?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询