VB中怎样使得picturebox控件在运行时可以移动
2个回答
展开全部
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Public Const WM_SYSCOMMAND = &H112
Public Const SC_MOVE = &HF012 '移动图片时用
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'拖动图片框。
ReleaseCapture
SendMessage Picture1.hWnd, WM_SYSCOMMAND, SC_MOVE, ByVal 0&
End Sub
用API函数
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Public Const WM_SYSCOMMAND = &H112
Public Const SC_MOVE = &HF012 '移动图片时用
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'拖动图片框。
ReleaseCapture
SendMessage Picture1.hWnd, WM_SYSCOMMAND, SC_MOVE, ByVal 0&
End Sub
用API函数
追问
你好, 复制你的代码还是不行!能加QQ吗?我发程序给你,Q:451533968
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你把程序发过来 我给你看看 我加你了 叫绝对0度
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询