Change the control class at runtime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a label on my form, but at runtime I would like to change it to a
LinkLabel. Is it possible to change the class of that label control at
runtime after the window is open? Is this possible?

Please advise.

Thanks
 
Hi ,

of course, like this:

LinkLabel ll = new LinkLabel();

ll.Left = label.Left;
ll.Top = label.Top ;
.......

this.Controls.Add ( ll );

label.Visible = false;
ll.Visible = true;



cheers,
 
Back
Top