private void botonNuevoPuntoBarra_Click(object sender, System.EventArgs e) { Plaza p = new Plaza(); p.Cod = GestorPlazas.NewCod++; p.isBarra = true; p.X = 0; p.Y = 0; GestorPlazas.AddPlaza(p); int i = GestorPlazas.getNumPlazas() - 1; this.panelDiseño.Controls.Add(GestorPlazas.getBotonDiseño(i)); GestorPlazas.getBotonDiseño(i).MouseDown += new System.Windows.Forms.MouseEventHandler(botonesDiseño_MouseDown); GestorPlazas.getBotonDiseño(i).MouseMove += new System.Windows.Forms.MouseEventHandler(botonesDiseño_MouseMove); GestorPlazas.getBotonDiseño(i).Click += new System.EventHandler(botonesDiseño_Click); }
public DiseñoForm() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // GestorPlazas.Load(); for (int i = 0; i < GestorPlazas.getNumPlazas(); i++) { panelDiseño.Controls.Add(GestorPlazas.getBotonDiseño(i)); GestorPlazas.getBotonDiseño(i).MouseDown += new System.Windows.Forms.MouseEventHandler(botonesDiseño_MouseDown); GestorPlazas.getBotonDiseño(i).MouseMove += new System.Windows.Forms.MouseEventHandler(botonesDiseño_MouseMove); GestorPlazas.getBotonDiseño(i).Click += new System.EventHandler(botonesDiseño_Click); } quitandoMesa = false; }