procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  if gdSelected in State then
  begin
    CheckBox1.SetBounds(Rect.Left + StringGrid1.Left + 2,
      Rect.Top + StringGrid1.Top + 2, StringGrid1.ColWidths[ACol],
     StringGrid1.RowHeights[ARow]);
  end;
end;

解决方案 »

  1.   

    TStringGrid本身就有编辑框,它从TCustomGrid派生而来,你看一下VCL源代码,就知道了。 另外TDBGrid也是一种Grid控件,甚至可以显示对话框。
      

  2.   

    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      if gdFocused in State then
      begin
        CheckBox1.SetBounds(Rect.Left + StringGrid1.Left + 2,
          Rect.Top + StringGrid1.Top + 2, Rect.right-Rect.left,
        Rect.Bottom-Rect.Top);
      end;
    end;
      

  3.   

    自己写个过程,判断CELLS以决定你是否想在此显示控件,设置VISBLED属性就行了.
    通过判断STRINGGRID.ROW使控件上下移动