Search Tools Links Login

To Keep a form on top of another (Only on top of one form, not of the whole application)

Visual Basic 6, or VB Classic

This is a very simple and precise solution to keep a form on top of only one other form. I was looking for a solution, but couldn't find it anywhere. All the codes and suggestions either keep the form on top of All windows programs or on top of the whole application. But this one will only keep one form on top of another one.

Original Author: Faisal Nawaz


' Let say you have two forms in your project, i.e. form1.frm and form2.frm. Now you want to open form2.frm from form1, but want your form2 to stay on top of form1 and also want to access the menu of form1 without causing the form2 to go behind. Here is the simple solution...

Private Sub Command1_Click()
   Form2.Show vbModeless, Form1
End Sub
I hope it will help you in your projects...

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 113 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.