Link to home
Start Free TrialLog in
Avatar of sidjey
sidjey

asked on

Cursor

Hello,

In windows 95 explorer, when you drag an item from the listview, the cursor change and reproduce the item. How can I do this in visual basic ? (i would like to drag a color box and my cursor reproduce this color box when i drag it).

Thanks a lot
Nathalie
Avatar of shchuka
shchuka

You need to set the DragIcon property of whatever control you are dragging.  This way the icon you set will be shown when dragged.

-Aleks.
Avatar of sidjey

ASKER

I know but I don't know how can I reproduce the item in the dragicon.
I don't think that Windows Explorer "reproduces" the icons when you drag something.  If it does, than it does some nighty stuff with graphics manipulation, basically taking the "screen shot" of the item, then creating the icon on the fly.  You can try doing something like that, but I don't think it'll be easy - and definitely once you create this icos (with API calls of course), you won't be able to simply assign them to the DragIcon property of control.
sidjey- Are the icons always going to be changing or is there only going to be a few you will need to "Drag"? Because you could (if there were only going to be a few) just make up a bunch of icons and then have the cursor change to these icons when needed. I don't think I am doing a very good job of explaining so let me think about how to say it better. If you don't under stand just say.
You can use ListItem.CreateDragImage
Avatar of sidjey

ASKER

It's ok for a listview but not for another control. I've a picturebox with a custom palette (createpalette). When I click on this picture, a small box appears with the color selected. I would like to drag this small box and the dragicon reproduce this small box with the same color. I don't know if it possible.
If you know how can i do this, please help me.
Thanks a lot
Nathalie
You can create a hidden listview, and use it's CreateDragImage method
ASKER CERTIFIED SOLUTION
Avatar of AnswerTheMan
AnswerTheMan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial