Solved

MDI-children

Posted on 1998-08-13
8
625 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
[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
  • 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
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!

 

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

Technology Partners: 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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

623 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