Реферат: Разработка текстового редактора
if ( RichEdit1->HandleAllocated() )
SendMessage(RichEdit1->Handle, EM_UNDO, 0, 0);
}
void __fastcall TForm1::PrintClick(TObject *Sender)
{
if (PrintDialog1->Execute()) RichEdit1->Print(OpenDialog->FileName);
}
void __fastcall TForm1::Print_SetupClick(TObject *Sender)
{
PrinterSetupDialog1->Execute();
}
void __fastcall TForm1::FindClick(TObject *Sender)
{
FindDialog1->FindText = RichEdit1->SelText;
FindDialog1->Execute();
}
void __fastcall TForm1::FindDialog1Find(TObject *Sender)
{
int FoundAt, StartPos, ToEnd;
if (RichEdit1->SelLength)
StartPos = RichEdit1->SelStart + RichEdit1->SelLength;
else
StartPos = 0;
ToEnd = RichEdit1->Text.Length() - StartPos;
FoundAt = RichEdit1->FindText(FindDialog1->FindText, StartPos, ToEnd, TSearchTypes()<< stMatchCase);
if (FoundAt != -1)
{
RichEdit1->SetFocus();
RichEdit1->SelStart = FoundAt;