It is important some times to dynamically generate controls for your application .
To do this use the following code given below:
Label l1=new Label();//creating an instance of the control
l1.Text="Code Snippet ";//Defining its properties like text ,width,height ,style etc
l1.Width="100px";
this.Controls.Add(l1);//Adding it to your page or form
This is a very simple code but is as useful .
Tuesday, June 10, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment