首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

在TStringGrid中安插TComboBox

2012-12-24 
在TStringGrid中插入TComboBoxWith Grid1? do??? begin????? nIndexCB : ARow ????? MyRect:CellRect(A

在TStringGrid中插入TComboBox
With Grid1? do
??? begin
????? nIndexCB := ARow ;
????? MyRect:=CellRect(ACol,ARow) ;
????? CB1.Visible:=True;
????? CB1.ItemHeight := 20;
????? CB1.SetBounds(Grid1.left+MyRect.Left+1,MyRect.Top+Grid1.Top+1,
????????? MyRect.Right-MyRect.Left+2 ,MyRect.Bottom-MyRect.Top +2);
????? CB1.Text:=Grid1.Cells[ACol,ARow];
????? i := Cb1.Items.IndexOf(Grid1.Cells[ACol,ARow]) ;
????? Cb1.ItemIndex := i;
????? CB1.SetFocus;
??? end;?With Grid1? do
??? begin
????? nIndexCB := ARow ;
????? MyRect:=CellRect(ACol,ARow) ;
????? CB1.Visible:=True;
????? CB1.ItemHeight := 20;
????? CB1.SetBounds(Grid1.left+MyRect.Left+1,MyRect.Top+Grid1.Top+1,
????????? MyRect.Right-MyRect.Left+2 ,MyRect.Bottom-MyRect.Top +2);
????? CB1.Text:=Grid1.Cells[ACol,ARow];
????? i := Cb1.Items.IndexOf(Grid1.Cells[ACol,ARow]) ;
????? Cb1.ItemIndex := i;
????? CB1.SetFocus;
??? end;?With Grid1? do
??? begin
????? nIndexCB := ARow ;
????? MyRect:=CellRect(ACol,ARow) ;
????? CB1.Visible:=True;
????? CB1.ItemHeight := 20;
????? CB1.SetBounds(Grid1.left+MyRect.Left+1,MyRect.Top+Grid1.Top+1,
????????? MyRect.Right-MyRect.Left+2 ,MyRect.Bottom-MyRect.Top +2);
????? CB1.Text:=Grid1.Cells[ACol,ARow];
????? i := Cb1.Items.IndexOf(Grid1.Cells[ACol,ARow]) ;
????? Cb1.ItemIndex := i;
????? CB1.SetFocus;
??? end;?

With Grid1  do    begin      nIndexCB := ARow ;      MyRect:=CellRect(ACol,ARow) ;      CB1.Visible:=True;      CB1.ItemHeight := 20;      CB1.SetBounds(Grid1.left+MyRect.Left+1,MyRect.Top+Grid1.Top+1,          MyRect.Right-MyRect.Left+2 ,MyRect.Bottom-MyRect.Top +2);      CB1.Text:=Grid1.Cells[ACol,ARow];      i := Cb1.Items.IndexOf(Grid1.Cells[ACol,ARow]) ;      Cb1.ItemIndex := i;      CB1.SetFocus;    end;

?

热点排行