我想可能要重写TstringGrid类的某个画图的方法吧...

解决方案 »

  1.   

    StringGrid1->FixedCols = 0;
    StringGrid1->FixedRows = 0;
      

  2.   

    to jsp
    不行啊,把我的标题拦搞没了
      

  3.   

    你是想要最顶上的一行不允许用户修改吧。
    StringGrid1.FixedCols := 0;
    StringGrid1.FixedColor := clWindow;
      

  4.   

    在你的ONSHOW事件里添加如下代码
    StringGrid1.Col:=1;
    StringGrid1.Row:=1;
    StringGrid1.SetFocus;
    就可以了
      

  5.   

    我知道你的意思了。就是被选择的那个单元的颜色问题。只能采用自画了。
    在ListView的OnDrawCell事件里写代码。下面的是C++Builder的写法。//----------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
    {
        TGridRect Rect;
        Rect.Left = -1;
        Rect.Top = -1;
        Rect.Right = -1;
        Rect.Bottom = -1;
        StringGrid1->Selection = Rect;
    }void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, 
        int ACol, int ARow, TRect &Rect, TGridDrawState State)
    {
        if (State.Contains(gdSelected)) {
            StringGrid1->Canvas->Rectangle(Rect);
            这儿输出文本的具体位置,你可以查一下Source
            StringGrid1->Canvas->TextOut(Rect.left+2,
                Rect.top+2, StringGrid1->Cells[ACol][ARow]);
        }
    }