cdiego

Agregar control dinámicamente

Sep 17th, 2013
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. TextBox txt = new TextBox(); //instancia de textbox
  2. txt.ID = ID; //establecer la propiedad  ID
  3. txt.AutoPostBack = true; // declarar otras propiedades, las que necesites
  4. txt.TextChanged += new EventHandler(OnTextChanged); //declarar eventos 
  5. panel1.Controls.Add(txt); // agregarlo a un panel por ejemplo
Advertisement
Add Comment
Please, Sign In to add comment