[SOLVED] TRichEdit and HandleAllocated after Create lazarus / 31-LCL ---------------------------------------------------------------------- Shebuka · 2011-07-25 12:57 Hi all, I'm trying to use this component and i'v encountered this behavior: When i create the form with TRichEdit without showing it and then try to add some strings via .lines.add(MyString); and set some Style via .SetTextAttributes(...) it's not working (the text formatting). It seems to not allocate the Handle until i Show the form: Code: [Select]procedure TCustomRichMemo.SetTextAttributes(TextStart, TextLen: Integer;    {SetMask: TTextStyleMask;} const TextParams: TFontParams); begin   if HandleAllocated then            <- This one is false     TWSCustomRichMemoClass(WidgetSetClass).SetTextAttributes(Self, TextStart, TextLen, {SetMask,} TextParams); end;Is there a way to force handle allocation? ---------------------------------------------------------------------- Shebuka · 2011-07-25 13:31 solved: after creating the form call .NeedHandle for the component you need the handle.