vb 图片拖动事件

把picture1的图片拖动到image1里面去并且把picture1的图赋到image1里面去。并触发一个事件msgbox“完成”PrivateSubImage1_Dr... 把picture1的图片 拖动 到image1里面去 并且把picture1的图赋到image1里面去。并触发一个事件 msgbox“完成”

Private Sub Image1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub Image1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)

End Sub

Private Sub Image1_OLECompleteDrag(Effect As Long)

End Sub

Private Sub Image1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)

End Sub

Private Sub Image1_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)

End Sub

Private Sub Image1_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)

End Sub

Private Sub Image1_OLESetData(Data As DataObject, DataFormat As Integer)

End Sub

Private Sub Image1_OLEStartDrag(Data As DataObject, AllowedEffects As Long)

End Sub

OLEDragMode=1
OLEDropMode=1
以上的方法全部用了。没有效果。。。郁闷了几天。。。
为什么我测试你的代码无反应的了?
是不是还要设置什么?你把源码E过来吗?27485203@qq.com
展开
 我来答
DreamMuse
2009-10-14
知道答主
回答量:0
采纳率:0%
帮助的人:0
展开全部
放个picture和image,什么属性都不用改,直接用下面代码,VB6调试通过。Image可以接受任意对象的图片,就是说,如果有两个Pictruebox,都能拖动,那拖哪个就得到哪个的图片。

'放开鼠标才触发,如果要拖过去就触发,用dragOver事件
Private Sub Image1_DragDrop(Source As Control, X As Single, Y As Single)
Image1.Picture = Source.Picture '参数Source代表了放在image上的所有正在拖动的控件
set source.Picture = nothing '删除对方的图片
MsgBox "完成"
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Picture1.Drag vbBeginDrag
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Picture1.Drag vbEndDrag
End Sub
罗小黑的金融之旅
2009-10-14
知道答主
回答量:0
采纳率:0%
帮助的人:0
展开全部
直接复制上就好了

Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
Picture1.Drag vbBeginDrag

End Sub

Private Sub Image1_DragDrop(Source As Control, X As Single, Y As Single)
Set Image1.Picture = Picture1.Picture

End Sub

Private Sub Image1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
Picture1.Drag vbEndDrag
MsgBox "操作完成"
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
?>

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式