Exemplo n.º 1
0
 private void Switch_Click(object sender, EventArgs e)
 {
     Output_Front s = new Output_Front();
     this.Controls.Add(s);
 }
Exemplo n.º 2
0
 private void OUTPUT_MouseDown(object sender, MouseEventArgs e)
 {
     textBoxLocation.Text = ActiveControl.Name.ToString();
     Output_Front newGate = new Output_Front();
     Form1.getInstance().Leds.Add(newGate);
     //GateFrontList.Add(newGate);
     Point d;
     d = Gate_Front.MousePosition;
     if (d.X < 2 * flowLayoutPanel1.Right && d.X > 0)
     {
         DoDragDrop(newGate, DragDropEffects.Link);
         newGate.Parent = panel2;
         mousePos = Gate_Front.MousePosition;
         // int dx = mousePos.X - DecentUserControlChild.Width - panel2.Left;
         // int dy = mousePos.Y - panel2.Top - 3 * DecentUserControlChild.Height + DecentUserControlChild.Height / 2;
         newGate.Location = new Point(mousePos.X - panel2.Left -  newGate.Width / 2, mousePos.Y - 100);
     }
 }