Solved

MDI-children

Posted on 1998-08-13
8
593 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:detempel
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:detempel
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

13 Experts available now in Live!

Get 1:1 Help Now