G
Guest
I have an application where I say essentially:
Type typeForm = Type.GetType(stringPassedIn)
Form frmX = null;
if (typeForm == Type.GetType("somenamespace.someform") {
frmX = new somenamespace.someform()
} else if (typeForm = Type.GetType("somenamespace.anotherform") {
frmX = new somenamespace.anotherform()
} else ....// and so an ad naseum for all the forms
Every time we add a form, we have to add it to this code. I want something much more generic.
What I want to be able to do is something like this
Type typeForm = Type.GetType(stringPassedIn)
Form frmX = new //something that uses the typeForm or stringPassedIN
Regards,
Madman Pierre aka Peter Horwood
Type typeForm = Type.GetType(stringPassedIn)
Form frmX = null;
if (typeForm == Type.GetType("somenamespace.someform") {
frmX = new somenamespace.someform()
} else if (typeForm = Type.GetType("somenamespace.anotherform") {
frmX = new somenamespace.anotherform()
} else ....// and so an ad naseum for all the forms
Every time we add a form, we have to add it to this code. I want something much more generic.
What I want to be able to do is something like this
Type typeForm = Type.GetType(stringPassedIn)
Form frmX = new //something that uses the typeForm or stringPassedIN
Regards,
Madman Pierre aka Peter Horwood