---
title: "swap picturebox in drag and drop"  
description: "swap picturebox in drag and drop"  
author: "Anonymous User"  
published: 2014-03-26  
updated: 2014-03-26  
canonical: https://www.mindstick.com/forum/1990/swap-picturebox-in-drag-and-drop  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# swap picturebox in drag and drop

Hi I've been [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to do a swap between two PictureBoxes with [drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5), the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) I'm using to do the drag and drop is C# Drag and Drop from one [Picture box](https://www.mindstick.com/forum/23034/picture-box-with-3-partitions-and-partitions-should-be-controlled-with-numeric-updown) into Another

But I have 9 pictureboxes and i need the swap to be [dynamic](https://www.mindstick.com/blog/11080/features-of-java-dynamic-complied-and-interpreted), cant manage to get the [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) of the picturebox from where the [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) is coming so i can do the swap, would [love](https://www.mindstick.com/articles/126121/love-is-money-money-is-love) some help on the subject.

## Replies

### Reply by Pravesh Singh

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


---

Original Source: https://www.mindstick.com/forum/1990/swap-picturebox-in-drag-and-drop

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
