如何做一个如下的表格控件? 派生于Tstringgrid,当点击进而的表格时,被点击的表格变成Tcombobox控件?谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是不是把COMBOBOX嵌到STRINGGRID中啊? ComboBox1.Visible := False;ComboBox1.Left := StringGrid1.Left + StringGrid1.CellRect(ACol, ARow).Left + 2;ComboBox1.Top := StringGrid1.Top + StringGrid1.CellRect(ACol, ARow).Top + 1;ComboBox1.Height := StringGrid1.RowHeights[ARow] + 3;ComboBox1.Width := StringGrid1.ColWidths[ACol] + 4;ComboBox1.Visible := True; procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);忘了说上边程序添加在这个事件下边:StringGrid1的OnSelectCell事件 pipengli(li) (dbgrid是先把字段联接起来对吗? MyStringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);var MyRect :TRect ;begin with StringGrid1 do begin MyRect := CellRect(Row,Col) ; ComboBox1.SetBounds(MyRect.Left + Left + 1,MyRect.Top+Top+2, MyRect.Right - MyRect.Left,MyRect.Bottom - MyRect.Top); ComboBox1.Text := Cells[Row,Col]; ComboBox1.SetFocus ; endend; 好像在field属性中的,type选择lookup就行了,dbgrid有些功能的! 目标IP地址和目标PORT端口 数据库的备份,运行出错,请高手指点 用QReport打印从数据库中选取的数据时,每页只打印一条记录!!!求救!! 在线等 画图问题 treeview如何表示它选中的项? 请教一个printdialog问题 請問各位徎序員。怎樣把图片存入数据庫呀? 请问谁能给点库存管理流程的建议?详细请进! 国内专业的注册表论坛,欢迎各位朋友捧场,担任斑竹。 怎样把一个控件嵌入到菜单?? 我如何能得到数据库中表名的列表,在ComboBox中,急再线等 第三方控件
ComboBox1.Left := StringGrid1.Left + StringGrid1.CellRect(ACol, ARow).Left + 2;
ComboBox1.Top := StringGrid1.Top + StringGrid1.CellRect(ACol, ARow).Top + 1;
ComboBox1.Height := StringGrid1.RowHeights[ARow] + 3;
ComboBox1.Width := StringGrid1.ColWidths[ACol] + 4;
ComboBox1.Visible := True;
ACol, ARow: Integer; var CanSelect: Boolean);
忘了说上边程序添加在这个事件下边:StringGrid1的OnSelectCell事件
ARow: Integer; Rect: TRect; State: TGridDrawState);
var MyRect :TRect ;
begin
with StringGrid1 do
begin
MyRect := CellRect(Row,Col) ;
ComboBox1.SetBounds(MyRect.Left + Left + 1,MyRect.Top+Top+2,
MyRect.Right - MyRect.Left,MyRect.Bottom - MyRect.Top);
ComboBox1.Text := Cells[Row,Col];
ComboBox1.SetFocus ;
end
end;