TWinControl.WMSize loop detected lazarus / 31-LCL ---------------------------------------------------------------------- Avishai · 2012-12-22 13:42 This is a Windows ONLY issue.  I am using this code to make controls RightToLeft: Code: [Select]procedure RTLCtrl(ACtrl: TObject); { Make TWinControl RightToLeft - Windows ONLY! } begin {$IfDef Windows}   if ACtrl is TWinControl then     with TWinControl(ACtrl) do begin       SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE)         or RightToLeftLayout or NoInheritLayout);   end; {$EndIf} end; It works for most TWinControls, but if I put a TComboBox on a TPageControl.TTabSheet, it generates this message: Project project1 raised exception class 'Exception' with message: TWinControl.WMSize loop detected, the widgetset does not like the LCL bounds or sends unneeded wmsize message: ComboBox1:TComboBox BoundsRealize=l=132,t=40,r=232,b=64 NewBoundsRealize=l=232,t=40,r=###(gdb unparsed remainder:...)### Any ideas on fixing this? ---------------------------------------------------------------------- Avishai · 2012-12-22 14:17 This is very strange.  I did some more experimenting and found that if I add TComboBox + TLabel + TEdit to a TPageControl.TTabSheet and run it, I don't get the Error.  But if I Anchor the TLabel to the TEdit and run it, I get the Error.  Even if I remove the anchor, I get the Error.  I have to delete the TLabel and add a new one.  Then it will run again. Further investigation:  I tried NOT setting anchors at Design-Time and Adding a TButton to the Form.  I added code to set anchors in the OnClick event of the TButton.  I can run the application without problem, but as soon as I click the button, I get the Error.  So the problem seems to be related to Anchors but How is a mystery. ---------------------------------------------------------------------- Avishai · 2012-12-23 09:49 More investigation: TForm + TComboBox + TLabel = Runs OK Anchor TLabel to TCombBox = Error Message Why only TComboBox??? ---------------------------------------------------------------------- User137 · 2012-12-23 10:23 Did you make a new empty project before doing this test? Just to draw out all outside influences. ---------------------------------------------------------------------- Avishai · 2012-12-23 10:32 Thanks User137:  Yes, I started fresh this morning with a new project.  I'm trying to work it down to the most basic level.  I don't understand how Anchors is effecting it.  I tried setting a breakpoint in WinControl.inc at RealizeBounds and it seems that the Error occurs elsewhere.