Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows
Visual Basic > Forms sample source codes
How to make a form stay 'on top' of all other windows 16bit.
How to make a form stay 'on top' of all other windows 16bit. 'Note: This has only been tested with VB 3 and VB 4-16, if you convert ' Declare this API and these Constants: Declare Function SetWindowPos% Lib "user" (ByVal h%, ByVal hb%, ByVal x%, ByVal y%, ByVal cx%, ByVal cy%, ByVal f%) Const SWP_NOMOVE = 2 Const SWP_NOSIZE = 1 Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE Const HWND_TOPMOST = -1 Const HWND_NOTOPMOST = -2 ' Add the following code to the appropriate event: ' Set TopMost Dim success% success% = SetWindowPos%(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, Flags) ' Remove TopMost Dim success% success% = SetWindowPos%(Form1.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,Flags)
Privacy Policy
|
Link to Us
|
Links