MDI application lazarus / 34-Windows ---------------------------------------------------------------------- libaudf · 2015-08-14 09:49 Hi, I'm actually develop an MDI application for Linux, Windows and others. But I've discovered a bug on Windows release with LCL on the 2.6.x version. Some posts speak about but with no solution. I've found an alternative to execute correctly and the code is :  oChildMDI := TChildMDI.create(self); oChildMDI.Parent:= self; {$ifdef WINDOWS} oChildMDI.Top:= 0; oChildMDI.Left:= 0; oChildMDI.Width:= ClientWidth - 4; oChildMDI:= ClientHeight - 4; {$else} oChildMDI.Align:= alClient; {$endif} oChildMDI.Show; And we need to specify properties : Align alNone BorderStyle bsNone FormStyle wsMDIChild The reason of the bug is that MDI child window bug on the loop message manager when Align property is set. ---------------------------------------------------------------------- Graeme · 2015-08-14 11:22 LCL is very inconsistent between it's widgetsets (LCL-gtk2, LCL-win32, LCL-qt etc). I experienced this back in 2005 and nothing has changed to date. Hence your IFDEF usage in you code - which funny enough is exactly what LCL is not supposed to do. As far as I know the only LCL widgetset that actually supports a usable MDI is LCL-Qt. So maybe you are better off using LCL-Qt on all your platforms, even Windows. But this makes deployment harder as you need to ship extra 3rd party (very large) libraries. Also since about the last 5+ years, nobody is really interested in tackling the MDI issues in Lazarus, so don't hold your breath for any fixes any time soon. Alternatively, switch to a truly cross-platform toolkit - something fully custom drawn and 100% implemented in Object Pascal. Something that is not just a bad abstraction layer on top of other toolkits. If you do that you will never need IFDEF's in your application code again.  I'm sure you could figure out what alternatives are available to you.