Solved

MDI FORMS

Posted on 1998-10-19
6
249 Views
Last Modified: 2012-05-04
I have opened up an application within an MDI Form.  That works fine.  However, I am attempting to place a MDI Child Form on top of that application.  It will act as a menu for that application.  Is it possible to have this "menu" stay on top of this application within the MDI Form?  Right now, my "menu" always remains in back of the application within the MDI Form.
0
Comment
Question by:NeedAnswer
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:schild
ID: 1440632
It is imposible, because MDI child will be always stay within MDI form border.
If you want this menu stay, you have one of the two option:
1. set the application menu the same as MDI child, and Show/Hide it while the MDI child is shown/hide
2. You can change the menu in runtime if you handle the menu items as an array at first place, which means you set a menu item's index to 0.

Good Luck
Schild
0
 

Author Comment

by:NeedAnswer
ID: 1440633
I understand that an MDI Child remains within the border of it's MDI Form.  But isn't it possible to force one MDI Child to remain on top of the other forms or applications that reside within the MDI parent Form.  I don't want it to remain on top of the MDI Form, just the other MDI Childs.
0
 
LVL 2

Expert Comment

by:schild
ID: 1440634
yes it is:

Public Const SWP_SHOWWINDOW = &H40
Public Const HWND_TOPMOST = -1
Public Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
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

Usage is:

SetWindowPos(MdiChildForm1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW)

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:NeedAnswer
ID: 1440635
This works for regular forms, but it does not seem to work for MDI Child forms.  I think that there is something small that I am missing.  I have done work like this for regular forms, but no MDI Child Forms.
0
 

Accepted Solution

by:
timpeters earned 50 total points
ID: 1440636
It is possible that the reason it wont stay on top of your app isbecause it is an app and not a form.  Try using the API Function SetParent where you place another form to be the parent of your app.  Then add this form to the MDI form and place your menu on top of that.  That should solve your problem.


0
 

Author Comment

by:NeedAnswer
ID: 1440637
Thanks, that took care of it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now