Home > DeveloperSection > Forums > swap picturebox in drag and drop
john rob

Total Post:108

Points:756
Posted on    March-26-2014 3:55 AM

 C# C# 
Ratings:


 1 Reply(s)
 823  View(s)
Rate this:

Hi I've been trying to do a swap between two PictureBoxes with drag and drop, the code I'm using to do the drag and drop is C# Drag and Drop from one Picture box into Another

But I have 9 pictureboxes and i need the swap to be dynamic, cant manage to get the name of the picturebox from where the image is coming so i can do the swap, would love some help on the subject.



Pravesh Singh

Total Post:411

Points:2881
Posted on    March-26-2014 4:29 AM

Hi John,

A global variable will do your thing like this;

PictureBox from;

when a drag starts from picturebox1 ;

From = picturebox1;

when a drag starts from picturebox2 ;

From = picturebox2;

when DragDrop a picturebox the from variable will be the images source


Don't want to miss updates? Please click the below button!

Follow MindStick