new Form by name?
-
[VB6] Anybody know of a way to create a new instance of a form if you only know the name of the form? Right now i'm doing a huge hack... a big select case statement. there has to be a better way!?!?!
-
[VB6] Anybody know of a way to create a new instance of a form if you only know the name of the form? Right now i'm doing a huge hack... a big select case statement. there has to be a better way!?!?!
Could you give us a better idea of what you are doing exactly. There are ways to create new forms programmatically. Nick Parker
-
Could you give us a better idea of what you are doing exactly. There are ways to create new forms programmatically. Nick Parker
aight, here's the deal... on the left, I have a treeview that holds a bunch of nodes which represent forms to open. They hold the name of the form as a string as their key. when somebody clicks on a node, it should open a new instance of the form, by name. If there is a better overall way to do the same effect, that'd be fine as well. The basic gist of what I want is a list of the form's which can be shown, and to make a new one when the user clicks on it. It is possible to open more than one of the same form at a time.
-
[VB6] Anybody know of a way to create a new instance of a form if you only know the name of the form? Right now i'm doing a huge hack... a big select case statement. there has to be a better way!?!?!
Dim myForm as Form Set myForm = new Forms("MyFormName")
I've seen something similar to that, but I don't have VB 6 installed so I can't check it. Should give you a start anyway, James Simplicity Rules! -
Dim myForm as Form Set myForm = new Forms("MyFormName")
I've seen something similar to that, but I don't have VB 6 installed so I can't check it. Should give you a start anyway, James Simplicity Rules!hrm the Forms collection only shows forms which are already loaded. besides, I don't think I'd be able to create a _new instance_ with this method. also, the New Forms("MyFormName") syntax doesn't compile. I even tried a CallByName hack ( Set myForm = CallByName( App, "MyFormName", vbGet ) ), but that didn't work either. any other ideas?