How To Create a Form That Always Stays on Top (184297)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 4.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 4.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q184297 SUMMARY
Microsoft Visual Basic does not offer a property or method to make a form
the topmost window. This behavior can be achieved using the SetWindowPos
Win32 API.
This article demonstrates how to set a form as the topmost window using the
SetWindowPos Win32 API.
REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
84251
How to Create a Topmost or Floating Window in Visual Basic
150233
BUG: Topmost Window Does Not Stay on Top in Design Environment
Also view the sample project, CallDlls, located in the VB\Samples\CallDlls
folder. The CallDlls sample has code to set a Form as the topmost window
and is illustrated in the sample.
Modification Type: | Minor | Last Reviewed: | 7/15/2004 |
---|
Keywords: | kbhowto KB184297 |
---|
|