|
-
Mar 17th, 2005, 02:04 PM
#1
Thread Starter
Member
Showing Forms
Hi,
I'm having a problem with opening two forms at once; when I open 1 form using vbmodal, the other form opened at the same time cannot be accessed. How can I overcome this?
Thanks
-
Mar 17th, 2005, 02:07 PM
#2
Lively Member
Re: Showing Forms
That is the usage of modal forms. If you make a form modal, any other form that belongs to the application can be accessed.
If you want to access two forms together, do not use vbModal.
Try to use MDI forms for accessing multiple forms.
System Halted..
-----------------------------------------
Sishe
-
Mar 17th, 2005, 02:20 PM
#3
Thread Starter
Member
Re: Showing Forms
I've never used an MDI Form and don't know what one is either.
Basically, I have three forms; one parent form, two child forms. What I want is that when the two child forms are opened from the parent form, the parent form becomes inaccessible (but still visible).
Thanks.
By the way: I already have the three forms created.
-
Mar 17th, 2005, 02:49 PM
#4
Lively Member
Re: Showing Forms
Assuming that you have 3 forms named Form1, Form2 and Form3. Lets say Form1 is the main form and has two buttons on it, Command1 and Command2.
Form1 Code;
VB Code:
Option Explicit
Public m_bForm2Opened As Boolean
Public m_bForm3Opened As Boolean
Private Sub Command1_Click()
If Not m_bForm2Opened Then Form2.Show
End Sub
Private Sub Command2_Click()
If Not m_bForm3Opened Then Form3.Show
End Sub
Private Sub Form_Activate()
If m_bForm2Opened And m_bForm3Opened Then Form2.SetFocus
End Sub
Private Sub Form_Load()
m_bForm2Opened = False
m_bForm3Opened = False
End Sub
Form2 Code;
VB Code:
Private Sub Form_Load()
Form1.m_bForm2Opened = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.m_bForm2Opened = False
End Sub
and Form3 Code;
VB Code:
Private Sub Form_Load()
Form1.m_bForm3Opened = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.m_bForm3Opened = False
End Sub
About MDI Forms follow the Link
System Halted..
-----------------------------------------
Sishe
-
Mar 17th, 2005, 02:56 PM
#5
Re: Showing Forms
A MDI form is like MS Word. Each document is a MDI child that opens in the parent. You can have many children in the parent, but when the parent closes, the children should also.
-
Mar 17th, 2005, 03:15 PM
#6
Thread Starter
Member
Re: Showing Forms
Thanks all
-
Mar 17th, 2005, 04:35 PM
#7
Re: Showing Forms
You can, if you like, just set frmMain.Enabled = False when the two child forms are displayed.
-
Mar 17th, 2005, 04:36 PM
#8
Re: Showing Forms
I remember something like that. The children don't close automatically, or something like that?
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
|