我需要ToolStripMenuItem在. Enabled_ 我尝试在互联网上搜索此内容,但 C++ 没有,所有答案都适用于 C#。ChildC++ .NET
我试试这个但不工作(menu_open是ToolStripMenuItem):
this->MdiParent->Controls["menu_open"]->Enabled=true;
我尝试:
(Form1)this->MdiParent->Controls["menu_open"]->Enabled=true;
和
((Form1)this->MdiParent)->Controls["menu_open"]->Enabled=true;
但不要找到Form1那是父母。请帮忙。
我试试这个:添加行
ref class Form1;
在子窗体和行的命名空间内
Form1^ parent;
在public ref class Child...里面 现在我有一个父表单的对象,我尝试:
parent->Controls["menu_open"]->Enabled = true;
但我有这个错误:
use of undefined type 'DataLogger::Form1'
left of '->Controls' must point to class/struct/union/generic type
left of '->Enabled' must point to class/struct/union/generic type
use of undefined type 'DataLogger::Form1'
left of '->Controls' must point to class/struct/union/generic type
left of '->Enabled' must point to class/struct/union/generic type