|
-
Sep 11th, 2000, 03:18 PM
#1
Thread Starter
Lively Member
I have a main form
It has several menus that open other forms.
Now if I open form1 and then click back on the main form to open form2, Form1 hides behind the main form.
How do I keep form1 in front of main form and allow form2 to be on top of both.
Basically like the desktop. Main form is the new desktop
VB 6 Professional Edition
-
Sep 11th, 2000, 03:34 PM
#2
Try this:
Code:
'Main Form
Form1.Show vbModal
'Form1
Private Sub Command1_Click()
Form2.Show vbModal
End Sub
-
Sep 12th, 2000, 08:26 AM
#3
Thread Starter
Lively Member
that only allows you to open one form.
I need to be able to open several forms
is there an API call?
VB 6 Professional Edition
-
Sep 12th, 2000, 09:09 AM
#4
transcendental analytic
I see the problem, you want to have the main form as the foreground form, by that you said you clicked on it, but still have the other forms above, you may have to set them on top?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 12th, 2000, 10:27 AM
#5
Thread Starter
Lively Member
Kedaman,
how is that accomplished?
VB 6 Professional Edition
-
Sep 12th, 2000, 10:50 AM
#6
transcendental analytic
For code in a module:
Code:
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
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
And to set any window, on top you pass it's handle, that is the hwnd property on a form:
Code:
SetWindowPos Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|