procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
var
Rect :Trect ;
// Pnt: TPoint;
begin
i:=ACol;
j:=ARow;
Rect :=stringGrid1.CellRect(ACol,ARow);
// combobox1.parent:=stringGrid1;
with Rect do
begin
/// ComBobox1.SetBounds(Pnt.x,Pnt.y,Right-left,Bottom-top);
ComBobox1.Left:=left;
ComBobox1.Top:=top;
ComBobox1.Width:=right-left;
ComBobox1.height:=Bottom-top;
combobox1.BringToFront;
ComBobox1.visible:=true;//Show;
comBoBox1.Focused;
end;
end;procedure TForm1.ComboBox1Change(Sender: TObject);
var
i1,j1:integer;
begin
ComBobox1.Text:=ComBoBox1.Items[ComBoBox1.ItemIndex];
StringGrid1.Cells[i,j]:= ComboBox1.Text;
combobox1.Hide;
end;
ARow: Integer; var CanSelect: Boolean);
var
Rect :Trect ;
// Pnt: TPoint;
begin
i:=ACol;
j:=ARow;
Rect :=stringGrid1.CellRect(ACol,ARow);
// combobox1.parent:=stringGrid1;
with Rect do
begin
/// ComBobox1.SetBounds(Pnt.x,Pnt.y,Right-left,Bottom-top);
ComBobox1.Left:=left;
ComBobox1.Top:=top;
ComBobox1.Width:=right-left;
ComBobox1.height:=Bottom-top;
combobox1.BringToFront;
ComBobox1.visible:=true;//Show;
comBoBox1.Focused;
end;
end;procedure TForm1.ComboBox1Change(Sender: TObject);
var
i1,j1:integer;
begin
ComBobox1.Text:=ComBoBox1.Items[ComBoBox1.ItemIndex];
StringGrid1.Cells[i,j]:= ComboBox1.Text;
combobox1.Hide;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货