派生于Tstringgrid,当点击进而的表格时,被点击的表格变成Tcombobox控件?谢谢了

解决方案 »

  1.   

    是不是把COMBOBOX嵌到STRINGGRID中啊?
      

  2.   

    ComboBox1.Visible := False;
    ComboBox1.Left := StringGrid1.Left + StringGrid1.CellRect(ACol, ARow).Left + 2;
    ComboBox1.Top := StringGrid1.Top + StringGrid1.CellRect(ACol, ARow).Top + 1;
    ComboBox1.Height := StringGrid1.RowHeights[ARow] + 3;
    ComboBox1.Width := StringGrid1.ColWidths[ACol] + 4;
    ComboBox1.Visible := True;
      

  3.   

    procedure TForm1.StringGrid1SelectCell(Sender: TObject;
      ACol, ARow: Integer; var CanSelect: Boolean);
    忘了说上边程序添加在这个事件下边:StringGrid1的OnSelectCell事件
      

  4.   

    pipengli(li) (dbgrid是先把字段联接起来对吗?
      

  5.   

    MyStringGrid1DrawCell(Sender: TObject; ACol,
      ARow: Integer; Rect: TRect; State: TGridDrawState);
    var MyRect :TRect ;
    begin
       with StringGrid1 do
       begin
          MyRect := CellRect(Row,Col) ;
          ComboBox1.SetBounds(MyRect.Left + Left + 1,MyRect.Top+Top+2,
              MyRect.Right - MyRect.Left,MyRect.Bottom - MyRect.Top);
            ComboBox1.Text := Cells[Row,Col];
            ComboBox1.SetFocus ;
       end
    end;
      

  6.   

    好像在field属性中的,type选择lookup就行了,dbgrid有些功能的!