PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Drag'n'Drop with Animation

Reply

Drag'n'Drop with Animation

 
Thread Tools Rate Thread
Old 10-02-2006, 10:47 AM   #1
JezB
Guest
 
Posts: n/a
Default Drag'n'Drop with Animation


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?



  Reply With Quote
Old 10-02-2006, 11:59 AM   #2
Mehdi
Guest
 
Posts: n/a
Default Re: Drag'n'Drop with Animation

On Fri, 10 Feb 2006 10:47:23 -0000, JezB wrote:

> 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.
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off