C#中的表单导航.按钮单击命令疑问 [英] Form navigation in C#. button click command doubt

查看:79
本文介绍了C#中的表单导航.按钮单击命令疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#窗口应用程序中,我正在创建一个form1和form2.
在form1中,我添加了一个按钮,当我单击该按钮时,我需要导航到form2.
难道是通过单击函数从一种形式导航到另一种形式的代码吗?

在此先感谢

问候
Victor

In a C# window application i am creating a form1 and form 2.
In form1 i am adding a button, when i click the button i need to navigate to form2.
wats is the code to navigate from one form to another by clikcing a function?

Thanks in advance

Regards
Victor

推荐答案

尝试以下代码
try the following code
form2 f2=new form2();
f2.show();
this.hide();


有关:
form2.Show()


注意:如果表格是模态的,将不起作用.


Note: will not work is forms are modal.


这篇关于C#中的表单导航.按钮单击命令疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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