Someone posted this a while back and it seem pretty good.VB Code:
Option Explicit Dim blnClicked As Boolean Private Sub Label1_DragDrop(Source As Control, X As Single, Y As Single) ' Use this event instead of the click event blnClicked = True Me.Print "Clicked" End Sub Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) With Label1 .ForeColor = vbBlue .Font.Underline = True 'path to hand cursor .DragIcon = LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Cursors\hand.cur") .Drag vbBeginDrag End With End Sub Private Sub Label1_DragOver(Source As Control, X As Single, Y As Single, State As Integer) If State = vbLeave Then With Label1 .ForeColor = vbBlack .FontUnderline = False .Drag vbEndDrag End With End If End Sub




Reply With Quote