怎样使datagrid当前行整行带颜色,在线给分。。。。

camlovecam 2003-08-21 09:38:06
怎样使datagrid当前行整行带颜色....
...全文
75 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
swayi21 2003-08-21
  • 打赏
  • 举报
回复
Sorry,

DBGrid1.Options := DBGrid1.Options + [dgRowSelect];

NOT dgRowSelected
swayi21 2003-08-21
  • 打赏
  • 举报
回复
dgRowSelected := True;

procedure TfmCustView.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if gdSelected in State then
begin
DBGrid1.Canvas.Brush.Color := clBlue;
DBGrid1.DefaultDrawColumnCell(Rect,DataCol,Column,State);

DBGrid1.Canvas.Pen.Color := $00C08000;
DBGrid1.Canvas.MoveTo(Rect.Left, Rect.Bottom);
DBGrid1.Canvas.LineTo(Rect.Right, Rect.Bottom);

DBGrid1.Canvas.MoveTo(Rect.Right, Rect.Top);
DBGrid1.Canvas.LineTo(Rect.Right, Rect.Bottom);
end;
end;
fangzhouyu 2003-08-21
  • 打赏
  • 举报
回复
up,我也想知道
camlovecam 2003-08-21
  • 打赏
  • 举报
回复
up

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧