1.读所有组件的 caption 属性:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TPropInfo *info;
String tmp;
TForm *FormTemp;
TObject *p;
Memo1->Clear();
for( int i=0;i<Application->ComponentCount;i++)
{
GetCaption ( Application->Components[i] ); }
}
void __fastcall TForm1::GetCaption ( TComponent *p )
{
int i,count;
String tmp;
TPropInfo *info;
count = p->ComponentCount;
for ( i=0; i<count; i++ )
{
GetCaption ( p->Components[i] );
info = GetPropInfo( p->Components[i], "Caption" );
if ( info )
{
tmp = p->Components[i]->Name + "=" + GetStrProp( p->Components[i], "Caption");
Memo1->Lines->Add( tmp );
}
}
return;
}
2.通过 SetStrProp ( FormTemp->Components[j], info, "SetStrProp"); 设置组件的属性;
3.通过读写一个 language.ini 可轻松实现界面的多语言支持;
4.TMutliLanguage 演示下载;