private void UserControl1_MouseDown(object sender, MouseEventArgs e) { dragClass tempDragClass = new dragClass(); tempDragClass.dragUserControl = this; DoDragDrop(tempDragClass, DragDropEffects.All); }
private void UserControl1_DragDrop(object sender, DragEventArgs e) { dragClass tempDragClass = (dragClass)(e.Data.GetData(typeof(dragClass))); UserControl_First = tempDragClass.dragUserControl; UserControl_Second = this; List <Control> List_Button = controlsSeparate(UserControl_First, UserControl_Second, "Button"); List <Control> List_Label = controlsSeparate(UserControl_First, UserControl_Second, "Label"); if (UserControl_First.label1.Text == "Button") { userControl_Arrange(UserControl_First, List_Button); userControl_Arrange(UserControl_Second, List_Label); } else { userControl_Arrange(UserControl_First, List_Label); userControl_Arrange(UserControl_Second, List_Button); } }