VBA


drag-and-drop - 2


End With

End If

End Sub

'

Private Sub Labell_MouseMove(ByVal Button As Integer,

ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

If Button = 1 Then

Set oooDataObject = New DataObject

Dim As Integer

Kono6oKDataObject.SetText Labell.Caption

= oooDataObject.StartDrag

End If

End Sub

Private Sub Label2_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean,

ByVal Data As MSForms.DataObject,

ByVal X As Single, ByVal Y As Single,

ByVal DragState As Long,

ByVal Effect As MSForms.ReturnEffeet,

ByVal Shift As Integer)

Cancel = True

Effect = fmDropEffectCopy

End Sub

Private Sub Label2_BeforeDropOrPaste(ByVal Cancel

As MSForms.ReturnBoolean,

ByVal Action As Long,

ByVal Data As MSForms.DataObject,

ByVal X As Single,

ByVal Y As Single,

ByVal Effect As MSForms.ReturnEffeet,

ByVal Shift As Integer)

Cancel = True

Effect = fmDropEffectCopy

Label2. Caption = KooDataObject .GetText

End Sub

Private Sub UserForm_Initialize()

'

Labell.BorderStyle = fmBorderStyleSingle

Label2.BorderStyle = fmBorderStyleSingle

With Imagel

.PictureAlignment = fmPictureAlignmentTopLeft

.PictureSizeMode = fmPictureSizeModeZoom

.BorderStyle = fmBorderStyleNone End With

'

End Sub

Sub ()

Imagel.Picture = LoadPicture("Dot_a.bmp")

End Sub

'

Sub ()

Image1.. Picture = LoadPicture ("Dotl_a.bmp"

) End Sub