trichview.com

trichview.support




onPaint Ficker


Return to index


Author

Message

Stephen Davenport

Posted: 04/28/2003 2:42:40


I am using the following code to draw a dark square after the MaxTextWidth

area to show that the area is not editable.  It works great except the

square flickers a some while the user scrolls and flickers alot while the

user selects text.  It seems the onPaint method is not double buffered.  How

can the flicker be avoided?


TIA,

Stephen Davenport


procedure Tform1.rvePaint(Sender: TCustomRichView;

  Canvas: TCanvas; Prepaint: Boolean);

var r: TRect;

begin

  Canvas.Pen.Style := psSolid;

  Canvas.Pen.Color := cl3DDKShadow;

  Canvas.Brush.Style := bsSolid;

  Canvas.Brush.Color := clBtnShadow;

  r := Rect(Sender.MaxTextWidth+Sender.RightMargin, 0, Sender.Width,

Sender.Height);

  // drawing

  Canvas.Rectangle(r);

end;







Powered by ABC Amber Outlook Express Converter