|
-
Oct 17th, 2001, 10:07 AM
#1
Thread Starter
Addicted Member
How to Use Load method?
Hi,
I am trying toload a form like this,But getting error.I want to load form and kept in memory.Any one know this how to do?
Load Form1 ? 'Getting error
Thanks.
-
Oct 17th, 2001, 10:09 AM
#2
Addicted Member
If I understand what you mean try.
form1.show vbmodal, me
this will 'load' a form.
-
Oct 17th, 2001, 10:12 AM
#3
Frenzied Member
If, when you do
Load Form1
you get an error then you should look at the form's Load event to see what code is being executed.
If you still can't see the error in the code, then set a breakpoint (F9) on the "Load Form1" line, and run the program.
When the program stops at the breakpoint use 'stepping' (F8) to step through each line of the load event until the error appears. That should help.
Form1.Show will load the form before showing it, so you should get the same error if you do this.
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Oct 17th, 2001, 10:20 AM
#4
Thread Starter
Addicted Member
I am explaining my requirement again.
I have two forms Form1 and Form2.
In Form1 load event I said Load form2.My thinking is when I run this program it has to show form1 and load Form2 but don't show me keep it in memory.
Now can you tell me can I do this?
-
Oct 17th, 2001, 10:25 AM
#5
Addicted Member
I have no idea why you would want to do this but try this.
in form1 onload event
VB Code:
form2.show vbmodal, form1
in form2 onload event
would that work?
-
Oct 17th, 2001, 10:43 AM
#6
Frenzied Member
Ok the load function loads objects into memory. So if you use the following syntax ( load form1) then the form will be loaded into memory and not displayed. I just tried it in my IDE(VB) and it works fine. There must be other problems with your first form. Try opening a new project and then create a second form and place a button on the first form.
In the load event of the first form place the following code
load form1 then in the click event for the button place the following code form1.show. If this all works fine then there is another problem and i would suggest using break on all errors in the options window. or use F9 to step through it.
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
|