|
-
Dec 4th, 1999, 06:02 AM
#1
Thread Starter
Junior Member
Hi,
Does anyone know how to keep a form showing at all times above another form. I need to be able to work on the bottom form while the other is above it.
I need to have something sort of like a legend key that is always there. My problem with the .show command is that if I use vbModal, I cannot click on the form below the top one. If I don't use vbModal, when I click the bottom form, the top form disappears under the bottom one.
Any help would be greatly appreciated.
Thanks,
dmuir
-
Dec 4th, 1999, 08:01 AM
#2
Junior Member
Dear DMuir:
Put in a module file (.bas) the commands:
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
'then, out in the program, to keep Form1 on top, use the command
Form1.Show
success% = SetWindowPos(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, flags)
'to prevent Form1 from being on top use
unload Form1
success% = SetWindowPos(Form1.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, flags)
That should work,
Good luck!
-
Dec 5th, 1999, 11:45 PM
#3
Thread Starter
Junior Member
Thanks, leif-p
It worked. That is just what I needed.
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
|