instantiating unknown form name
Hi,
Is there any way of creating an instance of a form when you do not know the name of the base form (if that is the correct term) until it is selected at runtime? I.E. Can you let the user select the base form and then store it in a variable which you can then use to create the instance?
We used to be able to do this easily in DOS programmes using a process called "Macro Substitution". I take it this is not available in VB.NET?
1 Attachment(s)
Re: instantiating unknown form name
There is a more elegant way to do what u want guys!
Use Assembly Class of System.Reflection Namespace to dig all the classes in the assembly
Store all types in a hashtable using its fullname as its key
Create a Function that will Create an Object depending on which ObjectType is selected using ConstructorInfo:
For more details , check on the attachment.
Re: instantiating unknown form name
This thread is 2 years old :), thats an interesting first post you have made.
Welcome.
Re: instantiating unknown form name
Wow.. it has been 2 years since I was first here... and it's been almost that long since I've worked in .Net!! I took a 6 week VFP contract in November of 2004 and I'm still on that gig.
I've been doing some DNN development, and recently a Java web application... believe it or not, I'm looking forward to getting back to VB!
Thanks for waking this thread up ramnujs!
Re: instantiating unknown form name
sorry guys , it was then i realized that this topic is 2 years old after i have clicked submit button. I just joined the forum and i was very excited to make some reply...