|
-
October 18th, 2001, 03:38 AM
#1
OLE Drag Drop for treeView control
I have a tree view control in my application. I want to drag a node from applications tree view control and drop it in another application. While dragging I want a paticular icon to be displayed against mouse pointer. Could anyone help me in doing this. I have tried DragIcon property but that changes the icon if you drag the control rather than the contents of the control. I also tries the screen.mousepointer and screen.mouseicon properties but could not achieve the desired function. Any help in this regard will be greated appreciated.
Thanks
Ali.
-
November 28th, 2001, 08:25 PM
#2
Re: OLE Drag Drop for treeView control
If you want to change the mouse pointer, you need to respond to the _OLEGiveFeedback event.
In the event handler for the control, first set "DefaultCursors" to false, then you can change the cursor through the Screen object.
Example:
Private Sub UserControl_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
DefaultCursors = False
Screen.MouseIcon = imglstDrag.ListImages.Item(GetDragImgID(m_DragNode.Tag.typeobj)).ExtractIcon
Screen.MousePointer = vbCustom
End Sub
Its kind of obsurce, but Microsoft actually documented it in the documented titled:
Dragging the OLE Drag Source over the OLE Drop Target
In the Visual Basic Concepts section of the MSDN library
-
November 28th, 2001, 08:46 PM
#3
Re: OLE Drag Drop for treeView control
I should have also mentioned that with the tree control, you will be responding to an event like TreeView1_OLEGiveFeedback, not usercontrol (as in the code example). Also, in the _OLECompleteDrag, you will need to set the screen.mousepointer back to vb default.
-
November 29th, 2001, 03:42 AM
#4
Re: OLE Drag Drop for treeView control
Treeview has a createDragImage property using which you can set an image.. i will check if i can provide you the code..
RK
-
November 29th, 2001, 09:48 AM
#5
Re: OLE Drag Drop for treeView control
Thankyou very much for your help.
Regards
Ali.
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
|
Click Here to Expand Forum to Full Width
|