hi to all iam new to .net. iam working in a windows application. i need to create a label through the code. i created a object of label through the new Label();
i dono how to add this in the form.
i did like this labal_name.show();
nothing is coming in the form . please help me.
Loading
ReginPosted Mar 12, 2008, 3:38 PM
AlanPosted Mar 12, 2008, 3:24 PM
To make it appear on the form, you have to add it to the form's Controls collection. For example:
Label
label1 = new Label();label1.Location =
new System.Drawing.Point(100, 300);label1.Name =
"label1";label1.Size =
new System.Drawing.Size(35, 13);label1.Text =
"Hello"; this.Controls.Add(label1);