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.
EdTheHoboAsked:
Who is Participating?
 
VKCommented:
Without waiting:
Form2.Show(vbModeless, Form1)
With waiting:
Form2.Show(vbModal, Form1)
0
 
Antagony1960Commented:
Start a new project with three forms and place a command button on Form1 and Form2.

'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
0
 
VKCommented:
And for Form 3:

Without waiting:
Form3.Show(vbModeless, Form2)
With waiting:
Form3.Show(vbModal, Form2)
0
 
EdTheHoboAuthor Commented:
Works perfect ^_^ Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.