应如何使StringGrid底颜色始终为黑色呢。我的StringGrid总是有一个单元格中的颜色为兰色。怎么设置都不行,最号有源代码。谢谢

解决方案 »

  1.   

    OnDrawCell:
     //if 条件
     begin
        StringGrid1.Canvas.Brush.Color := clblack;
        StringGrid1.Canvas.FillRect(Rect);
        with StringGrid1.Canvas do
          Textout(rect.left+3,rect.top+2,StringGrid1.Cells[ACol,ARow]);
     end;
      

  2.   

    OnDrawCell:StringGrid1.Canvas.Brush.Color := clblack;
        StringGrid1.Canvas.FillRect(Rect);
        with StringGrid1.Canvas do
          Textout(rect.left+3,rect.top+2,StringGrid1.Cells[ACol,ARow]);