|
-
Mar 7th, 2007, 09:47 PM
#1
Thread Starter
Hyperactive Member
drag drop
hi all
I have 4 buttons and a tablelayoutpanel with 5 cells
I want the buttons to be able to drag and drop in any of the cells
VS 2005 .....Framework SDK 3.0
"Its mostly the brave one who choose to not fight"
-
Mar 7th, 2007, 10:28 PM
#2
Re: drag drop
Drag and drop is a very standard mechanism and is performed in essentially the same way no matter the data being dragged. You should search MSDN to get the basics. Once you understand the principles involved then you'll understand what I'm about to say and where it fits in.
Handle the MouseDown event of the Buttons and pass the Button itself to DoDragDrop as the data. You then handle the DragDrop event of the TLP to get a reference to the Button that you need to drop. You can then calculate the column and row position of the mouse cursor and call the grid's SetCellPosition method to move the Button to that cell.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|