DragIcon in VBA?

  • Thread starter Thread starter Bart
  • Start date Start date
B

Bart

Dear All,

Does somebody know more about the DragIcon in VBA? I found out this
property doesn't exist in VBA. Is there a substitute? I would like to
choose the icon for the cursor while dragging.

Bart
 
Hi Bart,

I think that manipulation of the cursor is rather limited
in Excel.

See VBA Help for the application's Cursor property
and see the example code.
 
Thank you Norman Jones,

I only forgot to tell you the following.
On a UserForm I want to drag and drop a Tab of a TabStrip. I want this
so the user can change the order of the tabs. So far so good:
everything works fine. The 'DragIcon' is related to the set property
Effect. You can give an argument when using the method

fmDropEffect=Object.StartDrag([Effect as fmDropEffect])

But I would like to change the mouse pointer into a Custom Cursor Icon
when dragging a Tab. Is this possible? Tried several things. E.g. set
the property MouseIcon in the property window and in the sub
TabStrip1_BeforeDropOrPaste changing the MousePointer property into
fmMousePointerCustom. But now there's just the default cursor
(flickering a bit) while dragging. Only after dropping you see the
chosen MouseIcon.

Private Sub UserForm_BeforeDragOver(ByVal Cancel As
MSForms.ReturnBoolean, ByVal Control As MSForms.Control, ByVal Data As
MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal State
As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal
Shift As Integer)

Cancel = True
Me.MousePointer = fmMousePointerCustom

End Sub

Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top