Exemplo n.º 1
0
 private void insereE(String nome)
 {
     panelAlterar.Visible = false;
     pos++;
     try
     {
         leftAtual += 150;
         Button btnAux = buttonsAdded[0];
         upAtual = btnAux.Location.Y;
         Logica aux = (Logica)logicas[logica];
         aux.insereE(nome, pos);
         Panel pnl = panelsAdded[logica];
         #region peçaE
         Button btn = new Button();
         btn.Location          = new Point(leftAtual, upAtual);
         btn.Height            = 120;
         btn.Width             = 150;
         btn.Text              = nome;
         btn.Image             = imageList1.Images[2];
         btn.TextImageRelation = TextImageRelation.TextAboveImage;
         btn.FlatStyle         = FlatStyle.Flat;
         btn.Tag    = pos;
         btn.Click += delegate { btnLadder(btn, pnl); };
         pnl.Controls.Add(btn);
         buttonsAdded.Add(btn);
         btnLadder(btn, pnl);
         #endregion
         txtNome.Text = "";
     }
     catch
     {
         MessageBox.Show("Deve se iniciar com SEL ou SED");
     }
 }