添加模块 代码如下:Public Declare Function SendMessage lib "user32" Alias "SendMessageA" (ByVal hwnd As Long,ByVal wMsg As Long,ByVal wParam As Long,lparam As Any) As LongPublic Declare Function ReleaseCapture lib "user32" () As LongPublic Sub DoDrag(TheForm As Form) If TheForm.windowstate <> vbMaximized Then ReleaseCapture SendMessage TheForm.hwnd,&HA1,2,0& End IfEnd Sub在该控件的方法调用:Private Sub Label1_MouseDown(button As Integer,Shift As Integer,X As Single,Y As Single)DoDrag MeEnd Sub总结
以上是内存溢出为你收集整理的vb 点击控件移动窗体全部内容,希望文章能够帮你解决vb 点击控件移动窗体所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)