Recent

Author Topic: [SOLVED] Clicking on the X of a MDI child window does not close it  (Read 542 times)

EganSolo

  • Full Member
  • ***
  • Posts: 223
I'm working on an MDI application.

I've created a simple program with an fsMDIForm main window and an fsMDIChild secondary window.

Clicking on the X button to close the child window does nothing. I've checked the properties of the form and can't seem to find any property that needs to be set to get the child window to close.

Any idea why?

If my explanations are unclear, please check the attached image: Form1 is the main (fsMDIForm) form and Form2 is the child form. The cursor is set on the X of Form2 and clicking it does not close Form2.

« Last Edit: November 27, 2021, 10:33:58 am by EganSolo »

jamie

  • Hero Member
  • *****
  • Posts: 5024
Re: Clicking on the X of a MDI child window does not close it
« Reply #1 on: November 25, 2021, 01:25:34 pm »
you need to process the FormCloseQuery and set the CanClose := true;

and in the FormClose event, you need to decide there what to do, hide, free it etc..
The only true wisdom is knowing you know nothing

EganSolo

  • Full Member
  • ***
  • Posts: 223
Re: [SOLVED] Clicking on the X of a MDI child window does not close it
« Reply #2 on: November 27, 2021, 10:34:21 am »
Jamie: Thank you!
Much appreciated!

 

TinyPortal © 2005-2018