Hola Antonio.
Entonces ( si te animas
) probá este engendro que acabo de teclear...
Código Delphi
[-]
...
procedure TForm1.FormShow(Sender: TObject);
var
i: Integer;
begin
ComboBox1.Visible:= False;
for i:= 1 to 10 do ComboBox1.Items.Add(IntToStr(i));
ComboBox1.ItemIndex:= -1;
end;
procedure TForm1.ComboBox1Exit(Sender: TObject);
begin
StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row]:= ComboBox1.Text;
ComboBox1.ItemIndex:= -1;
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (gdSelected in State)and(ACol=1) then
begin
ComboBox1.Left:= Rect.Left + TStringGrid(Sender).Left + 2;
ComboBox1.Top:= Rect.Top + TStringGrid(Sender).Top + 2;
ComboBox1.Height:= Rect.Bottom - Rect.Top;
ComboBox1.Width:= Rect.Right - Rect.Left;
ComboBox1.Visible:= True;
end
else
ComboBox1.Visible:= False;
end;
...
Lo hice al vuelo y seguramente tengas que retocarlo un poco.... o al menos ojalá te dé alguna idea.
Un saludo.