|
-
Nov 18th, 1999, 05:01 PM
#1
Thread Starter
Hyperactive Member
-
Nov 18th, 1999, 07:44 PM
#2
Form Ontop does work. Copy this to your MDI form's General Declaration:
Code:
Private 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
Private Const SWP_NOMOVE = 2
Private Const SWP_NOSIZE = 1
Private Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Public Sub MakeOnTop(hWnd As Long)
Dim lRet As Long
lRet = SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
End Sub
Then when you want to show your Child form use this:
Load frmChild
MakeOnTop frmChild.hWnd
frmChild.Show
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 18th, 1999, 09:44 PM
#3
Thread Starter
Hyperactive Member
Thank you Serge
Just a few more questions for clarity.
Which general declaration? Mdi-parents, "modal" Mdi-child's or Mdi-child that shows the "modal" Mdi-child.
I have tried putting your code in all three places and it only works when I put it in the calling mdi-child(halfway ).
I dont get any errors when I call my "modal form, but when I click on the form in the background my "modal" form disaperes. It is placed behind the form I clicked on.
I don't know if it makes any differens that I'm calling my "modal" form from another Mdi-child and not from the Mdi-parent.
------------------
On Error Goto Bed :0)
[email protected]
[This message has been edited by onerrorgoto (edited 11-19-1999).]
-
Nov 18th, 1999, 09:50 PM
#4
If you call your Child forms from an MDI form then use MDI form.
You can have only one (1) MDI form in your project, so I suggest that you put that in General Declaration of an MDI form (the only MDI form in your project)
If you call your Child forms from some other places, then you can put that in a module (.BAS)
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 18th, 1999, 10:24 PM
#5
Thread Starter
Hyperactive Member
Well I only have one MDI-form(MDIParent) and two MDI-child forms(MDIChild1 and MDIChild2).
When I click a commandbutton on MDIChild1 I want to put MDIChild2 "allways on top".
(MDIChild2 is half the size of MDIChild1.)
So I put your code in a modul.
And my MDIChild2 shows as I call it. But when I click anywhere on MDIChild1, MDIChild2 is placed behind MDIChild1 (Bad child)
------------------
On Error Goto Bed :0)
[email protected]
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
|