-
Solved: Forms - creating a wizard with moving parts
Hello,
Is it possible using a Userform to create a wizard that has moving parts like Excel 2003's Pivottable wizard (i.e. labels with field names can be moved and dropped into the pivottable zones). I have tried it with labels but they are fixed when the Form is displayed
Any help would, as always, be appreciated
All the best
Phil
-
If you put this in a userform's code module, you can drag Label1 around the userform with the mouse.
[VBA]Dim xNull As Long, yNull As Long
Dim Work As Boolean
Private Sub Label1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
xNull = x
yNull = y
Work = True
End Sub
Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
If Work Then
With Label1
.Left = .Left + (x - xNull)
.Top = .Top + (y - yNull)
End With
End If
End Sub
Private Sub Label1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Work = False
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules