labelEdit获取值问题
如题,主窗体内创建动态窗体,
void __fastcall TFrmMain::MYCClick(TObject *Sender)
{
TFrmTest *frmTest=new TFrmTest(this);
try
{
frmTest->ShowModal();
delete frmTest;
}
catch(Exception &exception)
{
delete frmTest;
Application->ShowException(&exception);
}
}
然后,TFrmTest内创建类,该类库为引用外部类库
TTest Test;
然后 Test类内获取LableEdit的输入变量,
void TTest ::GetParameter(struct PlanModels &Result)
{
try{
Result.n=StrToInt(FrmTest->LEdit_n->Text);
//---
//问题:LEdit_n->Text在程序设置时默认text值为3,为何输入值在程序运行后,人工在LEdit_n输入4后,
//为何Result.n依旧===3,不是人工输入的4
}
catch(...)
{ throw;}
}
程序的编译通过了,就是不能获得程序运行后手工输入的LableEdit的值,获取值永远是程序界面设计时LableEdit的text属性默认值
[解决办法]
疑似同时存在多个FrmTest实例。