コード例 #1
0
ファイル: Sistema.cs プロジェクト: jvfrodrigues/ladder-editor
 private void insereEN(String nome)
 {
     panelAlterar.Visible = false;
     pos++;
     try
     {
         leftAtual += 150;
         Button btnAux = buttonsAdded[0];
         upAtual = btnAux.Location.Y;
         Logica aux = (Logica)logicas[logica];
         aux.insereEN(nome, pos); Panel pnl = panelsAdded[logica];
         #region peçaEN
         Button btn = new Button();
         btn.Location          = new Point(leftAtual, upAtual);
         btn.Height            = 120;
         btn.Width             = 150;
         btn.Text              = nome;
         btn.Image             = imageList1.Images[3];
         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");
     }
 }