EdTheHobo
asked on
Make a form stay on another form
Hi, I was wondering how to make one form stay on top of another form. Example:
I have 2 forms, Form1 and Form2. When the user clicks on form 1, I want Form2 to stay on top of it. Also, I don't want Form2 to be above everything. So if I have a Form3 and they click on it, it will go above forms 1 and 2, but Form2 is still above Form1.
I am using VB6.
I have 2 forms, Form1 and Form2. When the user clicks on form 1, I want Form2 to stay on top of it. Also, I don't want Form2 to be above everything. So if I have a Form3 and they click on it, it will go above forms 1 and 2, but Form2 is still above Form1.
I am using VB6.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And for Form 3:
Without waiting:
Form3.Show(vbModeless, Form2)
With waiting:
Form3.Show(vbModal, Form2)
Without waiting:
Form3.Show(vbModeless, Form2)
With waiting:
Form3.Show(vbModal, Form2)
ASKER
Works perfect ^_^ Thanks.
'Form1 code:
Option Explicit
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Activate()
If Form2.Visible Then Form2.Show
End Sub
Private Sub Form_Load()
Load Form2
Load Form3
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
'Form2 code
Option Explicit
Private Sub Command1_Click()
Form3.Show
End Sub