On Sun, 29 Jan 2012 00:03:48 +0000 Howard Page-Clark <[email protected]> wrote:
> On 28/1/12 9:00, Mattias Gaertner wrote: > > Hint: > > You don't need the Delphism "set Parent first" under LCL. The above will > > create a lot of updates. > > > > procedure TForm1.AddTab(AFileName: String); > > var > > Sheet: TTabSheet; > > Ed: TSynEdit; > > begin > > Sheet := TTabSheet.Create(pagecontrol1); > > Sheet.Caption := 'Unnamed'; > > Ed := TSynEdit.Create(Sheet); > > ed.Align := alClient; // fill the whole sheet > > ed.LineText := 'specimen line'; > > ed.Parent := Sheet; > > PageControl1.ActivePage := Sheet; > > sheet.Parent := PageControl1; // set Parent as last to reduce updates > > end; > > Thanks for the hint. I would not have known that from reading the wiki - > I think it is worth documenting there somewhere. I added a note to TWinControl.Parent. Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
