如何关闭UserControl? [英] How to Close UserControl ?

查看:572
本文介绍了如何关闭UserControl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf中关闭用户控件

this.Close();不适用于用户控件.

How to close user control in wpf

this.Close(); does not work with user control.

推荐答案

UserControl托管在可以关闭的内部.它不能独立于容器而关闭.但是,您可以做的是更改控件的可见性,以使其不会呈现出来.
A UserControl is hosted inside something that can be closed. It cannot be closed independently of the container. What you can do, however, is change the Visibility of the control so that it doesn''t get rendered out.


没有关闭任何Control这样的概念.您认为这会产生什么意义?您可以使用Control.Hide将其隐藏.

—SA
There is no such concept as closing of any Control. What sense do you think it would make? You can hide it though using Control.Hide.

—SA


这篇关于如何关闭UserControl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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