嗨..使用Visual Studio 2013我想在父窗口中打开子窗体,我只需单击父窗口子窗体即可关闭。如何为此编码 [英] Hi.. Using Visual Studio 2013 I Wanted To Open Child Form In Parent Window And I F One Click Parent Window Child Form Should Close. How To Code For This

查看:221
本文介绍了嗨..使用Visual Studio 2013我想在父窗口中打开子窗体,我只需单击父窗口子窗体即可关闭。如何为此编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..使用visual studio 2013

我想在父窗口中打开子窗体,我只需单击父窗口子窗体即可关闭。如何为此代码编写

解决方案

建议#1:从未以这种方式设计UI。从你的评论(非常感谢你的澄清),我可以看到你想在MDI客户端没有被孩子占用的区域中,当用户点击它之外时关闭MDI子表单。 你怎么能对你的用户如此敌视?我会理解你是否只想证明你掌握了一些UI技术,但对于真正的应用来说,这将是一场灾难。我认为这很明显为什么。



我的建议#2:永远不要使用MDI。以下是这个想法:谁需要MDI?为什么要折磨自己并吓跑你的用户?

帮自己一个大忙:根本不要使用MDI。没有它,您可以更轻松地实现设计,质量更好。 MDI甚至被微软高度劝阻,事实上,微软将其从WPF中删除并且很难支持它。更重要的是,如果您使用MDI,您将吓跑所有用户。只是不要。请参阅:

http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages

如何在WPF中创建MDI父窗口?



我可以解释做什么。请看我过去的答案:

如何在WPF中创建MDI父窗口?

关于在WPF中使用MDI窗口的问题

MDIContainer给出错误

如何设置最大化的子表单,最小化最后一个子表单



-SA

Hi.. using visual studio 2013
i wanted to open child form in parent window and i f one click parent window child form should close. How to code for this

解决方案

Advice #1: never ever design UI this way. From your comment (thank you very much for your clarifications), I can see that you want to close a MDI child form when a use clicks outside of it, in the area of the MDI client not occupied by children. How can you be so hostile to your users? I would understand if you just wanted to demonstrate you mastering of some UI technique, but for real application it would be a disaster. I think it's pretty obvious why.

And my advice #2: never ever use MDI. Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages,
How to Create MDI Parent Window in WPF?.

I can explain what to do instead. Please see my past answers:
How to Create MDI Parent Window in WPF?,
Question on using MDI windows in WPF,
MDIContainer giving error,
How to set child forms maximized, last childform minimized.

—SA


这篇关于嗨..使用Visual Studio 2013我想在父窗口中打开子窗体,我只需单击父窗口子窗体即可关闭。如何为此编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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