如何从主窗口中的按钮打开窗口 [英] How To Open a Window from a button in main window

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

问题描述

你好

如果可能的话,我需要帮助,

我的主窗口中有哪个按钮,

因此,我需要在单击此按钮时看到一个新窗口,但是,这个新窗口(从来没有来自主窗口界面)是我所需要的;如何从主"窗口中打开一个窗口,并且此新窗口"仅在主窗口中为钢

谢谢

解决方案


萨罗维,你好,

>>如何通过主窗口中的按钮打开窗口

通常,我们可以通过以下代码从中打开一个窗口.

 myWindow W =新的myWindow();

W.Show()或W.ShowDialog()


>>如何从主窗口中打开一个窗口,并且此新窗口仅在主窗口中

据我所知,WPF本身没有这样的功能,也许您可​​以参考下面的文章来实现.

WPF的多个窗口接口:
https://www.codeproject.com/Articles/22927/Multiple-Window-Interface- for-WPF

WPF多文档界面(MDI):
https://wpfmdi.codeplex.com/SourceControl/latest

Hammer.MdiContainer:
https://github.com/epinoema/Hammer.MdiContainer


注意:此响应包含对第三方万维网站点的引用. Microsoft为方便您而提供此信息. Microsoft不控制这些站点,也没有测试在这些站点上找到的任何软件或信息;所以, Microsoft无法对在此找到的任何软件或信息的质量,安全性或适用性做出任何陈述.使用Internet上发现的任何软件都存在固有的危险,Microsoft提醒您确保自己 从Internet上检索任何软件之前,请完全了解风险.

最好的问候,

吕汉楠



Hello 

I need a help if that possible , 

i have the main Window which button in it, 

so i need when click on this button , i see  a new window, but, this new Window, never from The Main Window interface, all what i need in my question is ; how to open a window from the Main windows, and this New windows steel in the Main window only 

Thanks

解决方案


Hi Sahraoui,

>> How To Open a Window from a button in main window

In general, we can through the following code to open a window from.

myWindow W = new myWindow();

W.Show() or W.ShowDialog()


>>how to open a window from the Main windows, and this New windows steel in the Main window only

As far as I know, WPF itself does not have such a function, perhaps you can refer to the following article to achieve.

Multiple Window Interface for WPF:
https://www.codeproject.com/Articles/22927/Multiple-Window-Interface-for-WPF

WPF Multiple Document Interface (MDI):
https://wpfmdi.codeplex.com/SourceControl/latest

Hammer.MdiContainer :
https://github.com/epinoema/Hammer.MdiContainer


Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Best Regards,

Yohann Lu



这篇关于如何从主窗口中的按钮打开窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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