Drag and Drop with visual feedback

Aperture

New member
Joined
Oct 29, 2008
Messages
1
Programming Experience
3-5
I have already implemented drag and drop between a ListView (with Symbols) and a PictureBox with the corresponding events. Now, I wonder wether it is possible to show the dragged list entry or the symbol at the position of the mouse pointer during the Drag&Drop process.
I hope you could understand what I want to say.
Thanks for your answers
 
Last edited:
I don't do a lot of work with graphics (read none) but I was able to get this working with a DataGridView. The ListView should be similare.

GiveFeedback event

VB.NET:
		e.UseDefaultCursors = False

		Dim bmp As New Bitmap(Me.dgv1.ClientSize.Width, 28)
		Dim gphc As Graphics = Graphics.FromImage(bmp)

		gphc.FillRectangle(Brushes.Transparent, 0, 0, Me.dgv1.ClientSize.Width, 28)
		gphc.DrawString("Your item text", Me.Font, Brushes.Gray, 0, 0)

		Cursor.Current = New Cursor(bmp.GetHicon)

The text looks a little weird like I'm drawing it twice a couple of pixels apart. Hopefully somebody who does graphics can come along and straighten that part out for you.
 
Back
Top