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
varchar sort
Nvidia Geforce 8400M GS in a Sony Vaio SZ650N/C WINDOWS 7 INCOMPATIBLE?
Is there an Access function equivalent to the Quartile function in Excel?
what is the difference between utf-8 or utf-7 both are unicode
WinMgmt errors in event log, started after applying latest updates
Building VPN with DI524 dlink router
how can i put a username and password of ms access dtabase?
Clear Orderby on exit of form
Global import into SQL Server 2000 related question
SSRS: Group Drill Down