在打开窗体时,让输入焦点定位在stringgrid的 第一个单元格上,怎么做啊?
就是cells[1,1]的位置上只是要设置什么属性的吧

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    Var
      myRect:TGridRect;
    begin
      myRect.Left := 1;
      myRect.Top := 1;
      myRect.Right := 1;
      myRect.Bottom := 1;
      StringGrid1.Selection := myRect;
    end;
      

  2.   

    stringGrid1.row:=1;
    stringGrid1.col:=1;
      

  3.   

    StringGrid1.Cells[1,1] := '';在第一个单元格输入一个''.
      

  4.   

    设置FORM的ActiveControl 最简洁
      

  5.   

    StringGrid.row := ..
    stringGrid.col := ..
    肯定能实现你的要求,不过会触发onclick 事件!解决方法见:
    http://community.csdn.net/Expert/topic/3128/3128168.xml?temp=.6639063
      

  6.   

    这样,可以让你定位到任何一个cell上!