|
-
Aug 3rd, 2003, 02:16 PM
#1
Thread Starter
New Member
Working with form class collection <Solved!>
I am new to vb.net, previous just an asp guy.
I would like to create a startup form that displays a list box of all available forms and then by pressing a button, displays the form selected in the list box. This just helps the process of reviewing the UI of each form.
This is not as easy as it sounds because there is not a forms collection. I have a couple of questions/thoughts:
1) Forms are just classes in vb.net so there must be a way to loop through the classes and find ones whose names start with frm. Not elegant, but might work.
2) I have the following code behind a button that is related to a text box
---------------------------------------------------
Dim frmName As String
Dim T As Type
'Get form Name, put project name in front
frmName = "prj_New_Project." & Me.txbx_Form_Name.Text
T = GetType(frmName)
Dim F As Form = Activator.CreateInstance(T)
F.Show()
-------------------------------
There is a build error that says 'Type frmName is not defined'.
3) Does anyone know how to get this to work?
Thanks
Last edited by shrub; Aug 3rd, 2003 at 07:31 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|