C++Builder LabelXXX循环赋值问题
Label1
Label2
Label3
Label4
Label...
实现循环赋值
for (...){
Label?->Caption = "I What";
} c++builder LabelX 循环赋值
[解决办法]
for (int i = 0; i < 5; i++)
{
TLabel *lbl = (TLabel *)FindComponent(String().sprintf(
TEXT("Label%d"), i + 1));
if (lbl)
lbl->Caption = String().sprintf(TEXT("标题%d"), i + 1);
}