Microsoft
Software
Hardware
Network
Question : How to build a control by its name as a string
Hi There,
i am trying to create a control on the fly by its name.
What i have
I have a a series of user controls that i have built
e.g UCMStep1, UCMStep2
and i want to pass what control to use from an XML file,
I am able to read the variable into a String, yet i cant for the life
of me work out how to create an instance of the control on the fly by its name.
If anyone is able to help me out or give me some guidance that owuld bre greatfully appreciated.
Cheers
Robbie
Answer : How to build a control by its name as a string
Type t = Type.GetType("YourObjectTy
peName");
YourObjectTypeName newObjectInstance = (YourObjectTypeName ) Activator.CreateInstance(t
);
Random Solutions
I need to save *dynamic* application settings in .NET 2.0 Winforms
SQL Server BIT field true and false
How do I remove the email header in Excel 2007
Can't open a .xlsx file when attached to an Outlook email
Windows Driver Kit inc\bugcodes.h look-up
ASP.NET Modal popup window
Remote Desktop Connection: win2003 server: local resources tab: Disk drives. Locally, can I see the drives of the computer I connect to remotely?
How to close excel file from Macro?
How do I insert an automatic check box for Word 2007
vba code to close form (with a subform) after user clicks on the back record navigation selector button