Results 1 to 2 of 2

Thread: [DELPHI] - Simple MDI Problem! [RESOLVED]

  1. #1

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    [DELPHI] - Simple MDI Problem! [RESOLVED]

    So simple i feel sad asking

    Basically ive not done much MDI programming before in Delphi, and my question goes like:

    If i create a new child form, i want the child caption to say "Child 1", then if i create another document it will say "Child 2", "Child 3" etc.

    Here is what ive got so far:

    procedure TfrmMain.NewFile;
    var
    FormCount: LongInt;
    begin
    TfrmEdit.Create(self);
    TfrmEdit(ActiveMDIChild).Caption:= 'Child ' + intTostr(FormCount + 1);
    end;

    But each new child shows Child 1 as the caption
    Last edited by Madboy; Aug 20th, 2005 at 02:07 PM.

  2. #2

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Re: [DELPHI] - Simple MDI Problem!

    The logic is simple now i realised:

    procedure TfrmMain.NewFile;
    var
    NewForm: TfrmEdit;
    begin
    NewForm:= TfrmEdit.Create(Self);
    NewForm.Caption:= 'Child ' + intTostr(MDIChildCount);
    end;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width