//---------------------------------------------------------------------------
//in
derived RichEdit (TMyRichEdit) source...
__fastcall
TMyRichEdit::TMyRichEdit(TComponent* Owner)
: TRichEdit(Owner)
{
FFirstPaint = true;
}
//---------------------------------------------------------------------------
void
__fastcall
TMyRichEdit::CreateWnd()
{
FFirstPaint = true;
TRichEdit::CreateWnd();
}
//---------------------------------------------------------------------------
void
__fastcall
TMyRichEdit::WMPaint(TMessage &Msg)
{
TRichEdit::Dispatch(&Msg);
if (FFirstPaint == true)
{
RECT R;
Perform(EM_GETRECT, 0, (LPARAM)&R);
R.left = R.left + 32;
Perform(EM_SETRECT, 0, (LPARAM)&R);
FFirstPaint = false;
}
}
|