VB dragdrop事件到底怎么用呀 谁能举个例子

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/27 15:54:59
VB dragdrop事件到底怎么用呀 谁能举个例子
xŔKA!AÄʂ 1N0;[zqnJPx KfgN n$z23{?LVg| "%a`^Q_vd]Eר6uaT{>ƉiClߦ($uKPeqqtx0R4nb qOeqȀ|b~a9i&WWU3aFؖcH#3 %(tY:c&ӊ[ostO|t9bxgTc'eX?۳3 xFp yq9^u&~Mg T#FiF;?Q^tR%q,6i6^*Lf%;>?~j/T0 76 ]]Bi}M9y׻gU4:;b /7O 

VB dragdrop事件到底怎么用呀 谁能举个例子
VB dragdrop事件到底怎么用呀 谁能举个例子

VB dragdrop事件到底怎么用呀 谁能举个例子

参考:http://iask.sina.com.cn/b/5207783.html

Option Explicit
    Dim cx As Long, cy As Long

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single) '在FORM的dragdrop事件中移动控件
    Source.Move X - cx, Y - cy
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '记录当前鼠标位置并开始拖动
    Picture1.Drag 1
    cx = X
    cy = Y
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) '结束拖动
    Picture1.Drag 2
End Sub