....TStringGrid  DrawCell  事件 

with Sender as TStringGrid do 

以下

    if not (gdFixed in State) then
    begin
      Canvas.Pen.Width := 1;
      // Draw top line
      if aRow > 1  then
      begin
        InflateRect(Rect, 1, 1);
        Canvas.Pen.Color := $00999999;
        Canvas.MoveTo(Rect.Left, Rect.Top);
        Canvas.LineTo(Rect.Right, Rect.Top);
      end;
      // Draw Right Line
      InflateRect(Rect, -1, -1);
      Canvas.Pen.Color := clBlue;
      Canvas.MoveTo(Rect.Right, Rect.Top);
      Canvas.LineTo(Rect.Right, Rect.Bottom);
      // Draw Bottom Line
      InflateRect(Rect, -1, 1);
      Canvas.Pen.Color := $00999999;
      Canvas.MoveTo(Rect.Right, Rect.Bottom);
      Canvas.LineTo(Rect.Left, Rect.Bottom);
      // Draw Left Line
      InflateRect(Rect, -1, -1);
      Canvas.Pen.Color := clYellow;
      Canvas.MoveTo(Rect.Left, Rect.Top);
      Canvas.LineTo(Rect.left, Rect.Bottom);
    end;

arrow
arrow
    全站熱搜

    kuraki5336 發表在 痞客邦 留言(0) 人氣()