tags:

views:

670

answers:

3

Hi, how can I prevent a Delphi MDI application from showing the caption of the currently maximized MDI child in the caption of the MDI parent form?

Thank you in advance!

+4  A: 

haven't had a chance to test this, but:

in the child OnResize, test for WindowState = wsMaximized. If it is, then set Caption := '' If not, set caption as required - you will need to need to remember this.

Gerry
This does work when the child form gets maximized, but not when it gets restored. Some more tweaking is necessary, but the solution should get the OP started. +1.
mghie
A: 

You can't. MDI is outdated stuff, and support for it is deprecated (actually, it has been for years). The limitations probably won't ever be changed because of the deprecation.

Ken White
+1  A: 

Tweaking Gerry's answer as mghie suggested:

private
  PreviousState: TWindowState;

procedure TMDIChildForm.FormResize(Sender: TObject);
begin
  if PreviousState = wsMaximized then
    Caption := 'Desired Caption'
  else if WindowState = wsMaximized then
    Caption := '';
  PreviousState := WindowState;
end;
Tiago Moraes