通过控件名获得控件
if(Form1->Controls[i]->Name != name)
{
Form1->Controls[i]->Caption=caption;//想改变该控件caption属性,但通过controls得不到caption,在网上查的只能通过强制转化成TLabel后才能取得caption,有没有更方便的方法啊???
}
[解决办法]
if (Form1->Controls[i]->ClassNameIs("TLabel"))
{
((TLabel *)Form1->Controls[i])->Caption = caption;
}