Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:19:14+00:00 2026-06-10T12:19:14+00:00

How can I hide a MDIChild window in Delphi? I’m using this code in

  • 0

How can I hide a MDIChild window in Delphi?

I’m using this code in FormClose() event of my MDI children, but it doesn’t seem to work:

procedure TfrmInstrument.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caNone;
  ShowWindow(Handle, SW_HIDE);
  frmMainForm.MDIChildClosed(Handle);
end;

My child window is minimized instead of being hidden.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:19:16+00:00Added an answer on June 10, 2026 at 12:19 pm

    There is a protected procedure in TCustomForm defined as:

    procedure TCustomForm.VisibleChanging;
    begin
      if (FormStyle = fsMDIChild) and Visible and (Parent = nil) then
        raise EInvalidOperation.Create(SMDIChildNotVisible);
    end;
    

    Override it in your MDI child windows as:

    procedure TMDIChildForm.VisibleChanging;
    begin
      // :-P
    end;
    

    Here’s a simple example

    After reading Jeroen’s comment, I tried another solution which works as well, but with a little flickering:

    procedure TMDIChildForm.VisibleChanging;
    begin
      if Visible then
        FormStyle := fsNormal
      else
        FormStyle := fsMDIChild;
    end;
    

    Maybe this works on all Windows versions.

    PS: I didn’t find any problem with the first solution on Windows 2k3SP2 x86 and Windows 7 Ultimate x86

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can hide the action bar in honeycomb using this code: getActionBar().hide(); But when
By using frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); can hide window. but how could i display another window after
I know that i can hide anything in codebehind, in selectionchanged event handler. But
HTML: <div id=box>my box</div>​ How come I can hide a visible div like this:
I can't hide my div using some i.e. explode effect in jquery ui, It
How can I hide an HTML form legend from visual browsers, using CSS, in
can some one show me how to hide/show tray icons of other applications/processes using
I'm using the following htaccess script so that I can hide index.php from the
Does anyone have any info or code on how to can hide a navigation
how can hide an element inside an iframe using either JQuery , javascript or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.