I have made an drag and drop program where i move a button into a panel, like in this picture below, but i don't know how to verify if panel1 contains button1, because i want to make a program where to match items from column A to column B(match buttons x to panel x and verify if all matches were right: button1 in panel1, button2 in panel2...).
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace proiect_istorie
{
public partial class DragAndDrop : Form
{
public DragAndDrop()
{
InitializeComponent();
}
private void panel_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void panel_DragDrop(object sender, DragEventArgs e)
{
Button bt = ((Button)e.Data.GetData(typeof(Button)));
bt.Parent = (Panel)sender;
bt.Dock = DockStyle.Fill;
bt.BringToFront();
}
private void button_MouseDown(object sender, MouseEventArgs e)
{
Button bt = (sender as Button);
bt.DoDragDrop(sender, DragDropEffects.Move);
}
}
}
and i have associated with every button and panel an event like in the pictures, and i don't know how to verify if the matches were right button1 in panel1...
