以编程方式打开表单 [英] Opening a form programmatically
本文介绍了以编程方式打开表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 winforms 项目,我需要单击主窗体 (Form1) 上的按钮打开另一个窗体.
I have a winforms project and I need to open another form on the click of a button on the main form (Form1).
什么是 C# 来做到这一点?
What is the C# to do this?
推荐答案
...
Form2 newForm = new Form2();
newForm.Show();
//or newForm.ShowDialog();
...
这篇关于以编程方式打开表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文