|
-
Aug 8th, 2000, 12:06 PM
#1
Thread Starter
Member
As you can see, frustration has ensued...
Here's my delimma:
I have a program with two forms. I click a command button on the first form (frmMain) and the second form (frmBrowse) pops up. I disabled frmMain while frmBrowse is up, but I need to know how to make sure that frmBrowse is always on top of frmMain.
The problem arises when I select frmMain in the taskbar. Both forms are on top of everything else, but frmMain is now on top of frmBrowse.
(oh, and I don't want to take frmMain out of the taskbar).
-
Aug 8th, 2000, 12:18 PM
#2
Fanatic Member
How about using vbModal function?
ex.
Code:
Private Sub Command1_Click()
Form2.Show vbModal
End Sub
Or use this code to keep form always on top
Code:
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40
Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Sub MakeNormal(Handle As Long)
'// Replaces the window in the ZOrder
SetWindowPos Handle, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Public Sub MakeTopMost(Handle As Long)
'// Sets the window in the ZOrder
SetWindowPos Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Post #513
-
Aug 8th, 2000, 02:37 PM
#3
Addicted Member
frog boy, what's up with that sig?
i was expecting a bit more =\
Generic vb 5
Private Sub WakeMyAssUp(  As Boolean)
If  Then  :  = False
End Sub
-
Aug 9th, 2000, 10:14 AM
#4
Thread Starter
Member
You mean the URL?
Sorry CWM...
If you are indeed referring to the link to the site... I just started it. As soon as I got everything setup, I realized that I had no content.
Any suggestions?!
-
Aug 9th, 2000, 10:26 AM
#5
Thread Starter
Member
BTW...
Thanks for the help, QWERTY! VBModal was EXACTLY what I was looking for...
It's usually the easiest things that get past me.
Last edited by FrogBoy666; Sep 18th, 2003 at 03:50 PM.
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
|