form creation
form creation
Hi again!
I'm having a witle problem:
I'm seen some were that you can make something like:
dim nf as new form1
and if you put in the cmd1 event:
nf
then it creates a new form
BUT
When i do it it says:
Compile error: (something more)
how can i do this the right way??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
I'm having a witle problem:
I'm seen some were that you can make something like:
dim nf as new form1
and if you put in the cmd1 event:
nf
then it creates a new form
BUT
When i do it it says:
Compile error: (something more)
how can i do this the right way??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
Re:form creation
Im sorry but you are going about this the worng way
GO ahead and make the form in Visual Basic and have it in your project set the visible property to false. Also if it asks for the startup form, say the form that you want to load *first* under Sub_Main
THEN
in the cmd1's click event have the code
and you can also say to hide teh first form...(the form that the cmd1 is on)
hope i helped ya!
GO ahead and make the form in Visual Basic and have it in your project set the visible property to false. Also if it asks for the startup form, say the form that you want to load *first* under Sub_Main
THEN
in the cmd1's click event have the code
Code: Select all
frm1.show
Code: Select all
Unload Me
hope i helped ya!
Re:form creation
that's not it!
i want my program to use a MDI form and "create" a duplicated form
i want my program to use a MDI form and "create" a duplicated form
Re:form creation
ok give me a few minutes and ill test this out for you...i think that i knwo how to do this and it should be easy
Re:form creation
ok not as easy as i thought...prehaps if you give me an example of what you are trying to do
i dont know if this is possible in VB because Forms dont have indexes...this means that a Load Object(Index) wont work...in other cases like in adding extra objects to a form....you would say for example
to add another to the for but the origonal button has to have an index specified as 0 to keep it as the origonal
this might work too...just make the form and if you want the properties to be the same as the other form then go
or something to that effect
so if you can give an example i can probabally give ya an answer
i dont know if this is possible in VB because Forms dont have indexes...this means that a Load Object(Index) wont work...in other cases like in adding extra objects to a form....you would say for example
Code: Select all
Load cmdButton(intIndex)
this might work too...just make the form and if you want the properties to be the same as the other form then go
Code: Select all
cmd2.Caption = frm1.cmd1.Caption
so if you can give an example i can probabally give ya an answer
Re:form creation
Ok, first you want to create a MDI Form...
Project > Add MDI Form
name this frmMain
Then you want to create a MDI Child to open many copies from within the MDI Form(Parent)...
Just set the property of a normal form to MDIChild = True
name this frmSubTemplate
Now, you want to call many copies of this child...
In a Module, declare this:
Global frmSub(# of child's you want) as New frmSubTemplate
Then you can open new Child's like so:
frmSub(#).Show
It will open it as a Child of frmMain
Project > Add MDI Form
name this frmMain
Then you want to create a MDI Child to open many copies from within the MDI Form(Parent)...
Just set the property of a normal form to MDIChild = True
name this frmSubTemplate
Now, you want to call many copies of this child...
In a Module, declare this:
Global frmSub(# of child's you want) as New frmSubTemplate
Then you can open new Child's like so:
frmSub(#).Show
It will open it as a Child of frmMain
Re:form creation
yeah...he is right.... i knew about that...i just didnt know that that is what your problem was :-\
BTW: hey meelWORM...didnt know that you visited Mega Toyko!
BTW: hey meelWORM...didnt know that you visited Mega Toyko!
Re:form creation
heheh thats great....the General Board is where i mostly hang out....but i also check the AGI board and this board *occasionally* to see if anyone needs any VB help
Re:form creation
I finaly found what must i do!
you only write this:
it works very well!
you only write this:
Code: Select all
function newwindow()
dim nw as new formname
nw.show
end function