我有一个在 C++/CLR Visual Studio 2012 中创建的 Windows 窗体应用程序。
目标是让用户将值输入到名为Home Page
. 然后,一旦填写了所有信息,他们单击一个按钮并Home Page
隐藏表单,然后Setup Info
显示调用的第二个表单。
我需要帮助的部分是Home Page
需要在Setup Info
. 要了解我的文件是如何设置的,这是我创建 C++ Windows 窗体应用程序时遵循的 youtube 视频,请单击此处。
在我的HomePage.h
// Button that will hide the Home Page Form and then show the SetupInfo Form.
private: System::Void Start_Click(System::Object^ sender, System::EventArgs^ e) {
this->Hide();
SetupInfo^ SetupInfo = gcnew ExcelToPPT::SeuUpInfo();
SetupInfo->Show();
}
在我的Setup Info.H
// When Setup Info is loaded button1 will have the text of textbox1 from Home Page Form.
private: System::Void SetupInfo_Load(System::Object^ sender, System::EventArgs^ e) {
button1->Text = HomePage->Textbox1->Text;
}
这是一般的想法,但它不起作用。我怎样才能让它工作?
如果您需要更多信息,请告诉我。
[编辑]
我可以通过外部全局变量来做到这一点,但是还有另一种方法可以直接访问文本文本框吗?
另外,当我退出我的Setup Information
它似乎并没有杀死我的程序时,我该如何解决这个问题?