用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;
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;