Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview OleDragDrop changing mouse cursor

vaxman9

Programmer
Feb 26, 2002
76
0
6
US
Greetings all

I am creating a simple file cabinet for one of my applications using the Treeview for the control, allowing the users to move items around via D&D and the basic functionality is in and working.

I want to change the mouse cursor to something a bit less bland than the defaults, I have done this with the native controls in the past and have had success, but the Treeview control is not cooperating or I am missing something (more likely). It doesn't help that the Help file for the Treeview control is somewhat limited. Additionally, the Ole D&D events for the Treeview have different parameters than native VFP controls, so I am not sure I can rely on the VFP Help for Ole D&D operations as a guide.

Here's my setup:

Properties:
OleDragMode = 1
OleDropMode = 1

Events
OleStartDrag - sets the data I am moving and sets AllowedEffects to 3 (move/copy) , which gives me the default cursorDRAGCOPY.pngwhen over an accepting area or NODROP02.png when over a non-accepting area.

OleDragOver - sets effect appropriately for what is under the dragged item.

The OleGiveFeedBack event fires and I tried many different values (from the VPF help) for defaultcursors parameter to see if I could get any change. Regardless of the value I set, the mouse pointer remains the default.

Not a show stopper, more of a "wonder what I am missing" question.

Any pointers or suggestion would be welcomed and appreciated.

thanks
msc

MS Treeview Control 6.0 (SP4)
VFP9 SP2
 
Have you tried setting the MouseIcon property from within the oleStartDrag event? You would set it to the name of a custom cursor file, which you can create in any decent picture editor (or use one of the cursor that come with VFP).

Mike
 
Hi Mike -

Thanks for the reply.

I tried your suggestion, but the Treeview.MouseIcon is an object and won't accept a string value, I get a Type Mismatch

I tried creating an ImageList, adding my cursor to it and then setting the Treeview.MouseIcon = ImageList.listimages[1], but I still get the Type Mismatch error.

I like what I have with the Treeview but with the poor documentation, it does make it difficult to play with.

msc
 
Hello S

That did allow the Treeview.MouseIcon to get set properly, but still no change in the displayed cursor.

Thanks!
msc
 

Part and Inventory Search

Sponsor

Back
Top