This is done through reflection which gives you the ability to use strings
to reference classes, assemblies etc.

Check out this article by Billy Hollis that does just what (I think) you are
after, right down to the list of forms being in an xml file.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/ht
ml/vbnet10082002.asp

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Jon Rothlander
Sent: Wednesday, February 15, 2006 11:49 AM
To: [email protected]
Subject: [ADVANCED-DOTNET] Dynamically Displaying WinForms.

 I should have changed the subject.... Sorry for the annoyance.

-----Original Message-----
From: Jon Rothlander [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, February 15, 2006 10:47 AM
To: 'Discussion of advanced .NET topics.'
Subject: RE: [ADVANCED-DOTNET] SupressContent property on HttpResponse


I have a need to display a form based on a the content of an XML file that
is loaded into a menu control.  Lets say that you have an XML that holds a
list of menu items that represent different forms within the app.  However,
depending on the client and the authority of the user, I do not know which
forms they will have access to.  So what I need to do is to load the users
list of forms via an XML file.  At that point, I will fill a menu list with
the controls.  When the user selects an item from the menu, I want to load
the form.

I used to do this in VB6 and I cannot figure out how to do this in .Net.
It's been so long since I have needed this, that I cannot recall how this
used to work in VB6 and I no longer have access to the VB6 code to see what
I was doing back 7 years ago.

It seems really simple, but I cannot figure out how to us a string with the
form name, to be used to create the new instance of the form.  Is there an
easy way to do this?

Something like....

Menu
        Form1
        Form2
        Form3

Button click for the menu items...

Dim frm as new form("form1")
frm.Show

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to