Solved

MDI FORMS

Posted on 1998-10-19
6
250 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

929 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

8 Experts available now in Live!

Get 1:1 Help Now