Главная страница | назад





Article #17648: Creating a page with RichEdit on the fly.

 Question and Answer Database
FAQ2648C.txt Creating a page with RichEdit on the fly.
Category :VCL
Platform :All
Product :C++Builder 3.x
Question:
How do I create a TabSheet on the fly, that has a RichEdit in it?
Answer:
void TClientForm::CreateANewPage(String TabName, String Doc)
{
TTabSheet *NewTabSheet = new TTabSheet(this);
NewTabSheet->Caption = TabName;
NewTabSheet->PageControl = SearchPgCtl;
TRichEdit *NewRichEdit = new TRichEdit(this);
NewRichEdit->ScrollBars = ssBoth;
NewRichEdit->PlainText = true;
NewRichEdit->WordWrap = true;
NewRichEdit->PopupMenu = SearchPopUp;
NewRichEdit->Parent = NewTabSheet;
NewRichEdit->Align = alClient;
NewRichEdit->Lines->Add(Doc);
NewRichEdit->SelStart = 0;
SearchPgCtl->ActivePage = NewTabSheet;
}
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99