Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MDI-children

Posted on 1998-08-13
8
Medium Priority
?
634 Views
Last Modified: 2010-04-04
I have an MDI-form with two MDI-childforms. Both children have the WindowState wsMaximized. However when I switch between them the WindowState alters to wsNormal. Why does it do this? The property BorderStyle is set to bsSingle and the buttons on the title-bar are all disabled. I want the user to see one child at a time. I've tried Show, BringToFront and SetFocus.
0
Comment
Question by:detempel
  • 4
  • 4
8 Comments
 
LVL 1

Expert Comment

by:pjdb
ID: 1362024
M$ has probably think that is you can't change the size of MDI chlids then you can't move from one to the other (they have forgot the standards commands ctrl-f6 and ctrl-tab)....

To solve it, reset the WindowState to wsMaximized in the OnActivate event of the child forms (it work on my computer).
0
 

Author Comment

by:detempel
ID: 1362025
Hello pjdb,

I have already tried that but before then you see the WindowState of the activated child change from normal to maximized. The title-bar jumps from directly under the menu-bar to directly above the menu-bar. I'd like to keep the title-bar above the menu-bar. The switch to another child should be reflected in a change in the caption of the title-bar of the parent.

Regards,
The Temple.
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1362026
An other way to solve you problam (without flickering this time ;-)

add procedure Resizing(var Msg: TWMSize); message WM_SIZE; to the form declaration (in the private section)

and add the folowwing

procedure TForm1.Resizing(var Msg: TWMSize);
Begin
  Msg.Result:=0;  //cancel the resize message
End;

JDB
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:detempel
ID: 1362027
Hello pjdb,

Doesn't work. In the meantime I've found out that my problem is solved when I set the BorderIcons biSystemMenu and biMaximize to True in the Child-forms. However I want all BorderIcons set to true.

Regards,
The Temple.
0
 

Author Comment

by:detempel
ID: 1362028
Hello All,

In the last comment I meant I want all BorderIcons set to FALSE. Sorry for the confusion!

The Temple.
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1362029
I've tried ny last solution (the one with the interception of the messages WM_Size) and it work fine. I'm working with Delphi 2.0, perhaps that's the problem.
Can you check that the program execute the code. If not, add 'override' after the definition of the method.

JDB
0
 

Author Comment

by:detempel
ID: 1362030
Hello JDB,

I've made an error. I have put the resizing method in the parent-form instead of the child-forms. It works fine now. By the way the help says you can't put an override on a message-method.

I think you've earned my points but I believe I can't give them to you anymore since I've rejected your answer. Maybe you should answer my question again so I can give you the points.

Thanks for the help,
The Temple.
0
 
LVL 1

Accepted Solution

by:
pjdb earned 80 total points
ID: 1362031
In fact It's hardly discourage to override any Delphi method because you can make big mistakes! That's why i did not propose this method first. Whoever, it's any esay way to intercept many things.

JDB
0

Featured Post

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!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

876 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