ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   DragIcon in VBA? (https://www.excelbanter.com/excel-programming/390440-dragicon-vba.html)

Bart[_6_]

DragIcon in VBA?
 
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


Norman Jones

DragIcon in VBA?
 
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.


---
Regards,
Norman



"Bart" wrote in message
oups.com...
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




Bart[_6_]

DragIcon in VBA?
 
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



All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com