小弟在FORM中有若干个组件,请问如何判断各组件是否有Caption属性,若有的把NAME放到一个ListBox中呢?万望各位大哥帮忙。
解决方案 »
- 怎么把数据库的字段转换成过程名?
- XML真的比INI好吗?
- 一个菜鸟的问题!!
- 如何编写手机程序
- 怎么样压缩一个文件夹呢?
- 关于格式转换的问题,怎么控制读文件,进来讨论下很实际的问题,来者有分,
- RE:########################################################################################################
- 这么晚了,喝点可乐提提神
- Access查询语句注释问题
- ?如何建立一临时查询然后其中进行统计(不是生成表,因为如果是表的话有十几万条记录如何能快速删除?)如果使用视图,如何在不关闭连接的情况下动态生成视图呢?我使用的是interbase5.6数据库.
- 在三层结构中如果我的GGG.CommandText:= 'select * from nm where bm= '''+edit1.text+''' ';EDIT1.TEXT中有单引号出现就会报错如何解
- 关于ADO控件?
Text1.Text = Label1.Caption
End If
ListBox1.Add.Items(Form1.组件名);
i:integer;
begin
for i:=0 to componentcount-1 do
begin
PropInfoPtr:=GetPropInfo(components[i],'caption');
if PropInfoptr<>nil then
begin
listbox1.Items.Add(components[i].Name);
end
end;
uses
TypInfo
Text1.Text = Label1.Caption
End If我是不是看错了,这个是Pascal代码?
implementationUses TypInfo;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
if IsPublishedProp(Components[I], 'Caption') then
ListBox1.Items.Add(Components[I].Name);
end;