?
Solved

MDI FORMS

Posted on 1998-10-19
6
Medium Priority
?
257 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 200 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

801 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