Jump to content

Drag 'n drop

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Automic

Automic

    Newbie

  • Members
  • Pip
  • 1 posts
Hello,

I need to be able to drag and drop some objects inside my windows application.
I also have objects in alot of shapes and I don’t want the standard bitmap square around them.

Posted Image
I want the drag and drop only to occur then the user clicks and holds on the A position or anywhere else inside the round object and not on the B position.

Could someone please recommend me some ways in accomplishing this.

Some restrictions:
- I can't use any other programming language.
- I can't use a .net higher then 2.0
- I can't use a website it has to be a windows application.

Thanks in advance!

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
The easiest way to accomplish this is to use a third-party component. Find one on Google, then download the DLL file, and add it in to your .NET project. There are many out there that have been created to help you out, as writing this sort of code is very complex.

If you must do it manually, you need to write some sort of condition code to detect where the mouse is. Use the MouseDown() event, as the MouseEventArgs "e" contains properties such as e.X and e.Y to tell you where the mouse is at current.

You can use an "if" statement to try and work out if the mouse is inside the circle or not. There are sometimes some Shape controls you can add from the Toolbox, which may only accept input from the mouse if it is inside the circle.

Xav