Solved

MDI-children

Posted on 1998-08-13
8
617 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
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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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