将一个窗口重定向到另一个窗口 [英] redirecting of one window to another window

查看:206
本文介绍了将一个窗口重定向到另一个窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将一个窗体重定向到另一个窗口

redirect of one windowform to another windowform

推荐答案

嗨。如果您使用WPF创建Windows应用程序,请执行以下操作:



Hi. If you working with WPF for creating windows application do like this:

private void NavigateButton_Click(object sender, RoutedEventArgs e)
        {
            ViewWindow secondWindow = new ViewWindow();
            secondWindow.Show();
        }



ViewWindow是另一个窗口。 NavigateButton位于当前窗口(MainWindow)。

i希望这对你有帮助。

祝你好运。


ViewWindow is another Window. NavigateButton is located on current window(MainWindow).
i hope this help you.
good luck.


我在假设你只想打开一个新表格并关闭当前表格。



I''m assuming you just want to open a new form and close the current form.

private void button_click(object sender,EventArgs e)
{
 new_Form  frmNew  = new new_From();
 this.Hide();
 
try
{
 frmNew.Show();
}
catch{}
}


这篇关于将一个窗口重定向到另一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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