社区
Delphi
帖子详情
在stringgrid里如何把一个控件嵌入cell里
zhmf
2002-07-17 11:56:23
在stringgrid里如何把一个控件嵌入cell里
如:把一个edit放到stringgrid的cell[2,1]
...全文
72
2
打赏
收藏
在stringgrid里如何把一个控件嵌入cell里
在stringgrid里如何把一个控件嵌入cell里 如:把一个edit放到stringgrid的cell[2,1]
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
sean2000
2002-07-17
打赏
举报
回复
unit Unit1;
interface
uses
Windows, Messages,stdctrls, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure StringGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
end;
var
Form1: TForm1;
i,j:integer;
var testcombo:Tcombobox;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
testcombo:=Tcombobox.create(self);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
testcombo.Free;
end;
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
i:=x div stringgrid1.defaultcolwidth;
j:=y div stringgrid1.defaultrowheight;
testcombo.parent:=self;
testcombo.left:=stringgrid1.left+i*(stringgrid1.defaultcolwidth+2);
testcombo.top:=stringgrid1.top+j*(stringgrid1.defaultrowheight+2);
testcombo.width:=stringgrid1.DefaultColWidth;
testcombo.Height:=stringgrid1.gridHeight;
testcombo.font:=stringgrid1.font;
testcombo.Items.Clear;
testcombo.text:='未知';
testcombo.Items.add('1111');
testcombo.Items.add('2222');
testcombo.Items.add('3333');
testcombo.Items.add('4444');
end;
end.
netlib
2002-07-17
打赏
举报
回复
动态或静态创建一个,
运行时候调整它的parent、top、left、visibled来决定是否显示以及显示的位置。
Delphi在
string
Grid
控件
中
嵌入
Combobox下拉框
Delphi在
string
Grid
控件
中
嵌入
Combobox下拉框,源码,供参考。
string
Grid
_delphi_
string
grid
delphi_delphi下拉
grid
_
Delphi为
String
Grid
控件
增加Combobox下拉框
String
Grid
Demo.
t
String
Grid
的
cell
中带有 comboBox
DataToExcel_VC++源码_
VC without OLE converts
String
Grid
/DB
Grid
Excel format
Delphi
String
Grid
控件
的用法
Delphi
String
Grid
控件
组件名称:
String
Grid
●固定行及固定列:
String
Grid
.FixedCols:=固定行之数;
String
Grid
.FixedRows:=固定列之数;
String
Grid
. FixedColor:=固定行列之颜色;
String
Grid
.Color:=资料区之颜色; ●资料行列之宽高
Delphi
5,928
社区成员
262,931
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章