去掉非聚焦 stringGrid 的最后选中的 cell 颜色

 

stringGrid 的cell 选中时会有蓝色,而且stringGrid离焦后那个蓝色依然会去,下面可以不管什么情况下都不显示蓝色  onDrawCell 事件

grid := TStringGrid(Sender);
  if(ARow <>0) then
  begin
  with grid do
    begin
      Canvas.Brush.Color :=clWhite;// ClBlue;
      Canvas.FillRect(Rect);
      Canvas.font.color:=ClBlack;
      Canvas.TextOut(rect.left , rect.top, cells[acol, arow]);
    end;
  end;

 

 

主要方式来源于    TStringGrid的使用

你可能感兴趣的:(去掉非聚焦 stringGrid 的最后选中的 cell 颜色)