ehlib 中的DrawColumnCell事件中写入事件,当选择某一行时,将该行的背景色和字体颜色做设置,以区分,但实际效果确实,选中某行时,鼠标所在单元格的颜色缺还是默认的深蓝色,一行中的其余单元格设置成功,试过更改EHLIB中的Option选项设置,都未成功,现将代码发布出来,望各位指点一二才是,不甚感激!procedure TfrmSignCtr.GridHouseInfoDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if State=[gdSelected] then
begin GridHouseInfo.Brush.Color:= clSkyBlue;
GridHouseInfo.Canvas.Font.Color:= clBlack;
GridHouseInfo.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end
else begin GridHouseInfo.Canvas.Font.Color:= clBlack;
end;
end;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if State=[gdSelected] then
begin GridHouseInfo.Brush.Color:= clSkyBlue;
GridHouseInfo.Canvas.Font.Color:= clBlack;
GridHouseInfo.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end
else begin GridHouseInfo.Canvas.Font.Color:= clBlack;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货