|
-
Mar 28th, 2000, 11:25 AM
#1
Thread Starter
New Member
I have 4 forms, the main form has 3 command buttons, how do I call the other forms one at a time and have only one visible at a time. I just need the code to put behind the command button. I now it's basic but I have never needed it b4. Thanks
-
Mar 28th, 2000, 11:30 AM
#2
Junior Member
Simple (your gonna hit yourself after this)
just do it like this
Private Sub Command1_Click()
Form1.Visible = False 'for every one you enable the
Form2.Visible = True 'other three should be disabled
Form3.Visible = False
Form4.Visible = False
End Sub
-
Mar 28th, 2000, 11:35 AM
#3
Hyperactive Member
Actually it might not be as simple as that.
You can make forms visible and invisible but if that is the only thing you do then whatever was contained on those forms when you were last there remains.
This means that if I was half way through entering into a text box then it would still be half entered when I went back to it.
This may be fine if thats what you want... but sometimes you want to display the form "refreshed" as if it was the first time you have seen it.
Also, by opening each of the forms (and remember that setting the Visible attribute causes it to LOAD if it isn't already) you actually have them ALL in memory and taking up space rather than only loading/unloading the one you want.
You might also want to consider if you are making this MDIChildren which means the forms exist INSIDE the big form with the command buttons. In this sense you could make them minimized instead (kind of like when you minimize a document in word) so you can bring the others up if you want.
Just something to consider
-
Mar 28th, 2000, 11:37 AM
#4
Thread Starter
New Member
Worked perfect thanks
Worked perfect thanks. Quick response
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
|