Advertisement
2_2002-2004 Custom Controls/ Forms/ Menus #112700

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

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.

AI

ИИ-обзор: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Исходный код
original-source
' 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...
Оригинальные комментарии (3)
Восстановлено из Wayback Machine