The topic pretty much says it all, but I should clarify that I do NOT want the second form to be ontop of EVERYTHING, just the one other form.
--Anders
Printable View
The topic pretty much says it all, but I should clarify that I do NOT want the second form to be ontop of EVERYTHING, just the one other form.
--Anders
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)
Private Sub Form_Load()
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
Hmm, no I've tried that. This makes the form ontop of everything. I only want it ontop of the form that opens it.
--Anders
VB Code:
'Form2 is the form being shown 'Form1 is the form it will stay on top of Form2.Show , Form1
See my question on Setwinword and Windows XP.
My problem is that this worked when I had win98 but i cant get it to work on win XP.
Let me know of your success.
PS I normally place the function call in the load procedure of the form that needs to be on top.
Hope this helps:)
I just read tyger's reply i'm going to try that!
yes tygur's suggestion works even in XP
how simple
Doh!!
Thanks very much!!!
Ok, now I feel like an idiot. :)
Thanks!
--Anders