Board index » delphi » MDI application & maximize MDI child problem

MDI application & maximize MDI child problem

I have a MDI appication that should be a kind of texteditor. On my
MDIChild I have a Memo aligned to alClient.

In my menu, I also have a windows menuitem (FrmMain.Windowmenu =
MnuMain_Window).

When I open two childwindows, maximize one of them and then choose in
the windows menuitem to display the 2nd form, the 2nd form is
displayed but the close button is disabled... I can only close the 1st
or 2nd form when I restore them to original size. This is quite
annoying and I don't know what I am doing wrong. Is there any solution
for this?

I hope my description was a clear enough. Many thanks on beforehand.

Happy coding, Phranc
--
=================
The optimist thinks this is the best of all possible worlds.
The pessimist fears it is true.
=================

http://huizen.dds.nl/~phranc/

 

Re:MDI application & maximize MDI child problem


Quote
On Tue, 21 Jul 1998 16:16:49 GMT, phr...@dds.nl (Phranc) wrote:
>I have a MDI appication that should be a kind of texteditor. On my
>MDIChild I have a Memo aligned to alClient.

>In my menu, I also have a windows menuitem (FrmMain.Windowmenu =
>MnuMain_Window).

>When I open two childwindows, maximize one of them and then choose in
>the windows menuitem to display the 2nd form, the 2nd form is
>displayed but the close button is disabled... I can only close the 1st
>or 2nd form when I restore them to original size. This is quite
>annoying and I don't know what I am doing wrong. Is there any solution
>for this?

I've written a sample program, and mine doesn't exhibit the behavior
you've described. Which version of Delphi do you use? (I have D3Pro.)

My main form looks like this:

unit Main;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, Menus;

type
  TMainForm = class(TForm)
    MainMenu: TMainMenu;
    miFile: TMenuItem;
    miFileNew: TMenuItem;
    miFileExit: TMenuItem;
    miWindow: TMenuItem;
    miWindowNext: TMenuItem;
    miWindowPrevious: TMenuItem;
    procedure miFileNewClick(Sender: TObject);
    procedure miFileExitClick(Sender: TObject);
    procedure miWindowNextClick(Sender: TObject);
    procedure miWindowPreviousClick(Sender: TObject);
  private
    NumFiles: integer;
  public
  end;

var
  MainForm: TMainForm;

implementation

uses Child;

{$R *.DFM}

procedure TMainForm.miFileNewClick(Sender: TObject);
begin
  ChildForm:=TChildForm.Create(Application);
  Inc(NumFiles);
  ChildForm.Caption:='File '+IntToStr(NumFiles)
end;

procedure TMainForm.miFileExitClick(Sender: TObject);
begin
  Close
end;

procedure TMainForm.miWindowNextClick(Sender: TObject);
begin
  Next
end;

procedure TMainForm.miWindowPreviousClick(Sender: TObject);
begin
  Previous
end;

end.

MainForm.WindowMenu is set to miWindow.

Other Threads