Custom drag and drop image

G

Guest

Is there a way to create a custom image under the cursor while performing a drag and drop operation (similar to what is done in Windows Explorer while draging files)? I know that you can use a custom cursor by setting gfbevent.UseDefaultCursors = False in a method that handles the GiveFeedback event. Is this what you need to do, or does it require some other technique? If so, then my next question is how to create a cursor on the fly that is a 32bit ARGB bitmap

Thanks for any help
Lance
 
P

Peter Huang

Hi Lance,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to make a shell like
drag&drop and generate a Cursor in the runtime.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

For the shell like drag&drop, I think you may try to take a look at the
link below.
Custom Drag-Drop Images Using ImageLists
http://www.vbaccelerator.com/home/VB/Code/Controls/ImageList/Custom_Drag-Dro
p_Images_Using_ImageLists/article.asp

http://www.vbaccelerator.com/home/NET/Code/Controls/ImageList/Sophisticated_
Drag_Drop_Images/ImageListDragCS.asp


For the creation of a cursor we may need to create a bitmap first and then
use the API call to create a cursor from the bitmap.

Dim bmp As New Bitmap(100, 100)
Dim gh As Graphics = Graphics.FromImage(bmp)
gh.DrawLine(New Pen(Color.Black), 0, 0, 100, 100)
Me.PictureBox1.Image = bmp


Creating a Color Cursor from a Bitmap
http://www.codeguru.com/Cpp/W-P/win32/cursors/article.php/c4529/

318876 HOWTO: Create an Alpha Blended Cursor or Icon in Windows XP
http://support.microsoft.com/?id=318876

http://groups.google.com/groups?q=CreateIconIndirect+cursor+C#&hl=zh-CN&lr
=&ie=UTF-8&oe=UTF-8&selm=eCiPnA2pCHA.504%40TK2MSFTNGP12&rnum=1


Please apply my suggestion above and let me know if it helps resolve your
problem.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top