如何在Visual Studio C ++中从另一个表单调用表单? [英] How do I call a form from another form in Visual Studio C++?

查看:112
本文介绍了如何在Visual Studio C ++中从另一个表单调用表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们.

我正在编写一个Windows应用程序,该应用程序主要由调用其他表单以添加/显示/编辑/删除信息的表单组成.换句话说,是数据库应用程序.

到目前为止,我已经设法创建了所有表单,并且第一个(继续或退出程序"表单)似乎可以正常工作.我正确地获得了Application :: Exit()命令.

我目前的问题:
1.如何使用按钮从另一个表单中调用表单?
2.如何编译整个程序以查看其是否正常工作?

我使用的模板是C ++/CLR/.NET Framework 4/Windows Forms Application.

非常感谢

Hi, guys.

I''m writing a Windows application that basically consists of forms calling other forms to add/display/edit/delete information. In other words, a database application.

I''ve managed so far to create all forms, and the first one (the "continue or exit the program" one) seems to be working. I got the Application::Exit() command right.

My questions, for now:
1. How do I call a form from another using buttons?
2. How do I compile the whole thing to see if it''s working?

The template I''m using is C++/CLR/.NET Framework 4/Windows Forms Application.

THANK YOU VERY MUCH

推荐答案


  1. 编写一个处理程序,并将其绑定到有问题的按钮.在此处理程序中,您可以创建新表单并显示它,或者显示该程序先前创建的现有表单.
  2. 假设您使用的是Visual Studio的某些版本,请使用标记为.


Form2 ^ form2 = gcnew Form2;
form2-> Show();
Form2 ^form2 = gcnew Form2;
form2->Show();


这篇关于如何在Visual Studio C ++中从另一个表单调用表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆