Создание TabSheet на лету с RichEdit на ней.
Компилятор: C++ Builder 3.x
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;
}
|