现在做一个程序,要将原有手工填写的表格做成电子版的,每个表都不一样啊,并且在输入的地方嵌入EDIT或COMBOX?用什么方法实现啊?

解决方案 »

  1.   

    用stringgrid嗎?這樣插個combobox
    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      if gdFocused in State then
      begin
        if (acol=1) then
        begin
          combobox1.Left:=StringGrid1.Left+rect.Left;
          combobox1.Top:=StringGrid1.top+rect.top;
          combobox1.Width:=rect.Right-rect.Left;
          combobox1.Height:=rect.Bottom-rect.Top;
          combobox1.Visible:=true;
        end
        else
        begin
          combobox1.Visible:=false;
        end;
      end;
    end;