Solved

MDI FORMS

Posted on 1998-10-19
6
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

724 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