How to Create a Modeless Dialog or Form in Visual BasicLast reviewed: June 21, 1995Article ID: Q114775 |
The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for Windows, versions 2.0 and 3.0
SUMMARYThis article contains information on how to create a modeless dialog or form in Visual Basic. An example of a modeless dialog is the toolbar in Microsoft Excel version 5.0 and Word version 6.0. A modeless form always displays on top of the parent form, but is not bounded by the parent form nor does it stay on top of all other applications as does SetWindowPos and HWND_TOPMOST. For additional information on SetWindowPos, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q84251 TITLE : How to Create a Topmost or Floating Window in Visual Basic MORE INFORMATIONThe Windows API SetWindowWord() is used with the value GWW_HWNDPARENT to change the parent of the form that you want to be a modeless dialog. SetWindowWord returns the original parent's window handle that we need to restore when the form is unloaded to avoid a General Protection Fault.
Step-by-Step Example
|
Additional reference words: 2.00 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |