Oct 25, 2010, 9:44 AM
how to add controls dynamically
hello,
I want to add control at run time. I have following code which is not working. so please tell me if i am missing something.
when user will click preview button following code will execute. the label should be create and added to panel1 which is present on the window(winFormGeneration), and we will make the Window visiable.
I want to add control at run time. I have following code which is not working. so please tell me if i am missing something.
when user will click preview button following code will execute. the label should be create and added to panel1 which is present on the window(winFormGeneration), and we will make the Window visiable.
protected void btnPreview_Click(object sender, DirectEventArgs e)
{
Ext.Net.Label lable1 = new Ext.Net.Label();
lable1.ID = "exam";
lable1.Text = "examNumber";
Panel1.Controls.Add(lable1);
WinFormGeneration.Show();
}
Last edited by geoffrey.mcgill; Oct 26, 2010 at 8:17 PM.
Reason: please use [CODE] tags