例えばこんな感じ
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
wRect:TRect;
begin
// 縦線を引く
self.StringGrid1.Canvas.Pen.Width:=2;
self.StringGrid1.Canvas.Pen.Color:=clGray;
wRect:=self.NexGrid1.CellRect(2,ARow);
self.StringGrid1.Canvas.MoveTo((wRect.Left+wRect.Right) div 2,wRect.Top+2);
self.StringGrid1.Canvas.LineTo((wRect.Left+wRect.Right) div 2,wRect.Bottom-2);
// セル内に斜め線を引く
self.StringGrid1.Canvas.Pen.Width:=2;
self.StringGrid1.Canvas.Pen.Color:=clGray;
wRect:=self.StringGrid1.CellRect(3,ARow);
self.StringGrid1.Canvas.MoveTo(wRect.Left,wRect.Top);
self.StringGrid1.Canvas.LineTo(wRect.Right,wRect.Bottom);
end;
0 件のコメント:
コメントを投稿