Advertisement
Guest User

Untitled

a guest
May 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             Label Lbl = new Label();
  4.             Lbl.Name = "slabel" + Idx.ToString();
  5.             Lbl.Text = textBox1.Text;
  6.             if (Idx == 1)
  7.             {
  8.                 Lbl.Location = Lbl.Location;
  9.             }
  10.              else
  11.             {
  12.                 var PrevCont = panel1.Controls.Find("slabel" + (Idx - 1).ToString(),true);
  13.                 Lbl.Location.X = PrevCont[1].Location.X;
  14.                 Lbl.Location.Y = PrevCont[1].Location.Y+10;
  15.  
  16.             }
  17.             panel1.Controls.Add(Lbl);
  18.             Idx++;
  19.             var c = new Choices();
  20.             c.Add(textBox1.Text);
  21.             var gb = new GrammarBuilder(c);
  22.             var g = new Grammar(gb);
  23.             rec.LoadGrammar(g);
  24.             rec.Enabled = true;
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement