您现在的位置:首页 >> VCL >> VCL >> 内容

Delphi中TDrawGrid选中单元格边框变色

时间:2011/9/3 16:25:21 点击:

  核心提示:procedure TMainForm.AllDrawGridClick(Sender: TObject);var Rect: TRect;begin Rect:=TDrawGrid(Sender)....

procedure TMainForm.AllDrawGridClick(Sender: TObject);
var
  Rect: TRect;
begin

  Rect:=TDrawGrid(Sender).CellRect(TDrawGrid(Sender).Col,TDrawGrid(Sender).Row);
  TDrawGrid(Sender).Canvas.Pen.Color := clFuchsia;
  TDrawGrid(Sender).Canvas.Pen.Width:=2;

  TDrawGrid(Sender).Canvas.MoveTo(Rect.Left, Rect.Top);
  TDrawGrid(Sender).Canvas.LineTo(Rect.Right, Rect.Top);

  TDrawGrid(Sender).Canvas.MoveTo(Rect.Left, Rect.Top);
  TDrawGrid(Sender).Canvas.LineTo(Rect.Left, Rect.Bottom);

  TDrawGrid(Sender).Canvas.MoveTo(Rect.Right, Rect.Top);
  TDrawGrid(Sender).Canvas.LineTo(Rect.Right, Rect.Bottom);

  TDrawGrid(Sender).Canvas.MoveTo(Rect.Left, Rect.Bottom);
  TDrawGrid(Sender).Canvas.LineTo(Rect.Right, Rect.Bottom);
end;

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
本类推荐
  • 没有
本类固顶
  • 没有
  • 盒子文章(www.2ccc.com) © 2022 版权所有 All Rights Reserved.
  • 沪ICP备05001939号