转到C#窗口应用程序中的periveous页面 [英] Go to perivous page in C# window application

查看:89
本文介绍了转到C#窗口应用程序中的periveous页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


朋友,我需要一个简单的代码.

对于C#Windows应用程序中的后退按钮

我已经写了这段代码

Hi
Friend i need a simple code.

For back button in C# windows Application

i have written this code

{
Console.writeline(@"from2");
}



它不会给我错误,但在运行时不会返回,请帮助纠正它

在此先感谢



its not giving me error but at runtime it is not going back please help to correct it

Thanks in advance

推荐答案

使用像这样

Form2 frm2 = new Form2();

frm2.Show();
Use Like this

Form2 frm2=new Form2();

frm2.Show();


这与Windows应用程序中的情况不同,就像我们在Web中使用的那样
It is not like that in windows application like we are using in web
i.e Response.Redirect("abc.aspx");



您不能使用



You cannot use

Console.WriteLine(@"pagename");


在WinForms中进行重定向,但为此,您需要具有表单对象并使用表单类的Show方法.


in WinForms to redirect but for that you need to have form object and use Show Method of form Class.
i.e.

Form2 form2 = new Form2();
form2.show();



如果有帮助,请 投票 接受答案 .



Please vote and Accept Answer if it Helped.


这篇关于转到C#窗口应用程序中的periveous页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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