Forms problem in VB6
How can I create a ?FORM? that always stay on top of desktop?
i.e. when I open a new program that ?FORM? hide behind the program, what I want is that ?FORM? always remain on top of any program which I open.
Web Development
How can I create a ?FORM? that always stay on top of desktop?
i.e. when I open a new program that ?FORM? hide behind the program, what I want is that ?FORM? always remain on top of any program which I open.
by grybyx
VB6 doesn't have a direct means of keeping a form on top of all others, but Microsoft KB article Q184297 has a workaround that uses a Win32 API function, SetWindowPos. You can use the following URL to view the article:
http://support.microsoft.com/support/kb/articles/Q184/2/97.asp
by aamsoh
You can use SetWindowsPos to do many things. One of them is to adjust its z-order prority as in the following example:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal yAs Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_SHOWWINDOW = &H40
Private Sub Form_Load()
Dim Result As Long
Result = SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.Left, Me.Top, Me.Width, Me.Height, SWP_SHOWWINDOW)
End Sub
I hope I helped.
by aamsoh
You can use SetWindowsPos to do many things. One of them is to adjust its z-order priority as in the following example:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_SHOWWINDOW = &H40
Private Sub Form_Load()
Dim Result As Long
Result = SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.Left, Me.Top, Me.Width, Me.Height, SWP_SHOWWINDOW)
End Sub
I hope I helped.
by aamsoh
by aamsoh
This discussion is closed to new replies.
Sort by Trending