在WPF中一次打开两个窗口 [英] Open Two Window at a time in WPF

查看:823
本文介绍了在WPF中一次打开两个窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我正在使用C#开发WPF。在WPF中,每个人都知道在运行代码时窗口是打开的。我在运行程序时需要打开两个窗口。请参阅App.xaml的基本代码:

< Application x:Class =TwoWindowProblem.App
xmlns =http:// schemas .microsoft.com / winfx / 2006 / xaml / presentation
xmlns:x =http://schemas.microsoft.com/winfx/2006/xaml
StartupUri =MainWindow.xaml> ;
< Application.Resources>
< /Application.Resources>
< / Application>



从这里我们可以看到Application Form使用StartupUri =MainWindow.xaml运行MainWindow。那么如何添加另一个窗口?我的程序的目的是 - 当我将在一个窗口中写入时,影响将显示在另一个窗口中。所以请通过提供一些示例代码来帮助我。

解决方案

你遗漏了一些基本的东西。示例代码?来吧,这就是你所需要的:

http ://msdn.microsoft.com/en-us/library/system.windows.window.show.aspx [ ^ ]。



-SA

Now I am working on WPF with C#. In WPF, Everyone knows when you run the code a window is open. I need to open two window at a time when I run the program. Please see this basic code of App.xaml :

<Application x:Class="TwoWindowProblem.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             StartupUri="MainWindow.xaml">
    <Application.Resources>
         </Application.Resources>
</Application>


From here we can see Application Form run the MainWindow by using StartupUri="MainWindow.xaml". So how can add another window ?? The purpose of my program is -When i will write in one window then the impact will show by another window.So please help me by providing some sample code.

解决方案

You are missing something basic. Sample code? Come on, this is all you need:
http://msdn.microsoft.com/en-us/library/system.windows.window.show.aspx[^].

—SA


这篇关于在WPF中一次打开两个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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