用按钮打开表格 [英] Open Form with Button

查看:66
本文介绍了用按钮打开表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2种形式的项目.

I have a project with 2 forms in it. How do I have a button on the first form that when clicked opens the second form, rather than a new blank form?

推荐答案

您好Deejesh Subramanian,

Hi Deejesh Subramanian,

谢谢您在这里发布.

对于您的问题,您想在form1中单击按钮时打开form2.请尝试以下代码.

For your question, you want to open form2 when click button in form1. Please try the following code.

     private void button1_Click(object sender, EventArgs e)
        {
            Form2 F2 = new Form2();
            F2.Show();
        }

这是输出.

如果您对此问题还有其他疑问,请随时与我们联系.

If you have something else about this issue, please feel free to contact us.

最好的问候,

温迪


这篇关于用按钮打开表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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