Advertisement
TLama

Untitled

Sep 4th, 2015
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.76 KB | None | 0 0
  1. procedure TForm1.VirtualStringTree1AdvancedHeaderDraw(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo;
  2.   const Elements: THeaderPaintElements);
  3. begin
  4.   if hpeBackground in Elements then
  5.   begin
  6.     PaintInfo.TargetCanvas.Brush.Color := clGray;
  7.     PaintInfo.TargetCanvas.FillRect(PaintInfo.PaintRectangle);
  8.   end;
  9. end;
  10.  
  11. procedure TForm1.VirtualStringTree1HeaderDrawQueryElements(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo;
  12.   var Elements: THeaderPaintElements);
  13. begin
  14.   // if there is no column assigned in the paint info, elements for the background painting are requested;
  15.   // this event fires later for plates as well, but we want to paint only the background by ourselves
  16.   if not Assigned(PaintInfo.Column) then
  17.     Elements := [hpeBackground];
  18. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement