Board index » delphi » Creating TTabSheets and RichEdit dynamically
Wee Jin Goh
![]() Delphi Developer |
Creating TTabSheets and RichEdit dynamically2003-06-27 10:10:55 PM delphi33 Hi, I'm trying to dynamically add pages to a PageControl. Each page on this PageControl is going ot have a Rich Edit control on it, that is maximised to the size of the control. You can guess I am trying to write a text editor that supports a tabbed view :-) Below is the code I am using to create the pages and the RichEdit. For some reason, the RichEdit doesn't want to appear. procedure TForm1.FormCreate(Sender: TObject); var ts : TTabSheet; i : integer; re : TRichEdit; begin i := 0; for i := 0 to 9 do begin ts := TTabSheet.Create(PageControl1); ts.PageControl := PageControl1; ts.Caption := 'Untitled' + IntToStr(i); re := TRichEdit.Create(ts); re.Left := 0; re.Top := 0; re.Width := ts.ClientWidth; re.Height := ts.ClientHeight; re.Visible := true; end; end; Any help would be appreciated. Thanks. Wee Jin |