Drag'n'Drop with Animation

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

I've mastered basic drag'n'drop, but I want to display more than just a
simple cursor when dragging an object, I also want to display a
semi-transparent representation of what I'm actually dragging as I move the
mouse, which in my case will be some text in a box with a fill image, but it
equally could be anything.

Anyone know how to achieve this?
 
I've mastered basic drag'n'drop, but I want to display more than just a
simple cursor when dragging an object, I also want to display a
semi-transparent representation of what I'm actually dragging as I move the
mouse, which in my case will be some text in a box with a fill image, but it
equally could be anything.

Anyone know how to achieve this?

I've never done that myself but i suppose that one solution would be to
create a Bitmap containg whatever you want to display as the mouse pointer
and set your cursor to be that Bitmap whenever you start dragging:
this.Cursor = new Cursor(cursorBitmap.GetHicon());

It only works with B&W bitmap though (transparency is supported) and the
cursor hot spot is always located at the center of your bitmap so you need
to take that into account when creating it. If you want to do fancier
things, you'll have to look at the CreateCursor API instead.
 
Back
Top