OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 4:45 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: form creation
PostPosted: Wed Apr 09, 2003 9:21 am 
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??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???


Top
  
 
 Post subject: Re:form creation
PostPosted: Wed Apr 09, 2003 10:13 am 
What language are you using? What error do you see?


Top
  
 
 Post subject: Re:form creation
PostPosted: Thu Apr 10, 2003 2:23 am 
visual basic


Top
  
 
 Post subject: Re:form creation
PostPosted: Thu Apr 10, 2003 8:47 pm 
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
Code:
frm1.show


and you can also say
Code:
Unload Me
to hide teh first form...(the form that the cmd1 is on)

hope i helped ya!


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat Apr 12, 2003 5:56 am 
that's not it!
i want my program to use a MDI form and "create" a duplicated form


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat Apr 12, 2003 3:20 pm 
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


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat Apr 12, 2003 3:26 pm 
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

Code:
Load cmdButton(intIndex)


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

Code:
cmd2.Caption = frm1.cmd1.Caption


or something to that effect

so if you can give an example i can probabally give ya an answer ;)


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat Apr 12, 2003 8:34 pm 
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


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat Apr 12, 2003 9:00 pm 
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!


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat Apr 12, 2003 10:56 pm 
SMG: I just registered today! ;D


Top
  
 
 Post subject: Re:form creation
PostPosted: Sun Apr 13, 2003 4:03 am 
Welcome to Mega-Tokyo! ;)


Top
  
 
 Post subject: Re:form creation
PostPosted: Sun Apr 13, 2003 7:29 am 
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 ;)


Top
  
 
 Post subject: Re:form creation
PostPosted: Sat May 10, 2003 11:07 am 
I finaly found what must i do!
you only write this:
Code:
function newwindow()
dim nw as new formname
nw.show
end function

it works very well!


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: SemrushBot [Bot] and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group