|
-
May 9th, 2001, 09:40 AM
#1
Stay On Top
Does anyone know how to make an MDIChild form stay on top of other MDIChild forms.
Thanks,
Patrick.
-
May 9th, 2001, 11:24 AM
#2
Re: Stay On Top
Not at all sure on this but you might want to investigate the BringWindowToTop API function.
-
May 9th, 2001, 02:02 PM
#3
Re: Stay On Top
this function will force a window to always be on top. It doesn't obey the MDI child rules though, 
public Const SWP_NOMOVE = 2
public Const SWP_NOSIZE = 1
public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
public Const HWND_TOPMOST = -1
public Const HWND_NOTOPMOST = -2
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
public Sub MakeTopMost(hwnd as Long, optional Topmost as Boolean = true)
If Topmost = true then 'Make the window topmost
Call SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
else
Call SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
End If
End Sub
call it like this to turn it on:
Call MakeTopMost(Form1.hwnd, true)
and to turn it off:
Call MakeTopMost(Form1.hwnd, false)
hope this helps,
john
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
John Pirkey
MCSD (VB6)
http://www.stlvbug.org
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|