var rect:TRect;
box:TCombobox;
begin
rect:=stringgrid1.CellRect(1,stringgrid1.Row);
box:=TCombobox.Create(form1);
box.Parent:=stringgrid1;
box.Visible:=true;
box.Left:=Rect.Left;
box.Top:=Rect.Top;
box.Width:=Rect.Right-Rect.Left;
box.Height:=Rect.Bottom-Rect.Top;
box.Items.Add('asd');
box.Items.Add('bbb');
但问题是选择的时候下拉框没有显示出来
box:TCombobox;
begin
rect:=stringgrid1.CellRect(1,stringgrid1.Row);
box:=TCombobox.Create(form1);
box.Parent:=stringgrid1;
box.Visible:=true;
box.Left:=Rect.Left;
box.Top:=Rect.Top;
box.Width:=Rect.Right-Rect.Left;
box.Height:=Rect.Bottom-Rect.Top;
box.Items.Add('asd');
box.Items.Add('bbb');
但问题是选择的时候下拉框没有显示出来
解决方案 »
- 为什么多了一个问号
- ADOTable打开一张表竟然要五分钟!关于Blob字段缓存问题??
- 为什么"在这台机器上启用分布式COM"选项会自动关闭?
- 如何实现图片居中(总是在屏幕的中间)?
- 推荐几本Delphi的书,希望深入学习Delphi。谢谢!
- 如何从其他程序(只能查询打印,无法导出数据)中取得数据?
- 菜鸟问题 delphi 的 listbox
- 添加限制单机运行的功能?怎么做?
- 怎样利用已有的帮助文件(COL文件打不开)
- 到哪找install shield for delphi 5.0 谢谢!
- 搞了好长时间,郁闷死了!请高手来看看!
- 为什么单独打开一个 pas文件 会出错 这样的问题怎么解决呢?
你加上一句stringgrid1.DefaultRowHeight :=xx;把行高度设置高一些就可以显示了
将Combobox的Parent设为self 即可
box.Parent:=self;不过 得修改其位置
box.Left:=Rect.Left + stringgrid1.Left;
box.Top:=Rect.Top + stringgrid1.Top;