[solved]ModalResult not recognized lazarus / 31-LCL ---------------------------------------------------------------------- Zvoni ยท 2022-02-24 09:53 Hi Folks, i'll bite. See attached project. Form1 calls Form2. On Form2 are 2 Buttons. I set ModalResult at Form2-Creation to mrCancel. Only Button1 sets ModalResult to mrOK. This way i thought to catch all 3 possible ways to close Form2: 1) Button1 (=OK) 2) Button2 (=Cancel) 3) the red X in the Upper Right corner of the Window Closing (actually Hiding!) Form2 returns mrCancel everytime, which i only expected for 2)+3) Note: this is of course a stripped down example. In my actual project i'm setting some Properties of Form2, which, after Form2 gets hidden, i read out in Form1 and go from there (classic "Child is not updating the Parent, but the Parent pulls from Child"). from Form1 i close and then Free Form2 Huh? EDIT: You gotta be kidding me.... https://forum.lazarus.freepascal.org/index.php?topic=20320.0 Setting ModalResult stops the Modal loop? OK, using now my own Property on Form2 to indicate how Form was closed/hidden