?
Solved

MDI-children

Posted on 1998-08-13
8
Medium Priority
?
629 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
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!

 

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

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.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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