WPF 控件默认大小 [英] WPF control default size
本文介绍了WPF 控件默认大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在为 wpf 应用程序定义自定义资源主题时,我可以设置宽度/高度等...如何找到这些属性的默认值(即框架中提供的控件中使用的值)?
When defining custom resource themes for a wpf application, I can set width / height etc... How can I find the default value for these properties (i.e. the values used in the controls provided in the framework) ?
推荐答案
FrameworkElements 的默认宽度和高度是 Double.NaN
.如果您没有指定不同的大小,WPF 控件将自动调整自身大小以尝试适应其内容、容器或两者.
The default width and height for FrameworkElements is Double.NaN
. If you don't specify a different size then WPF controls will automatically size themselves to try and fit their content, their containers or both.
这篇关于WPF 控件默认大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文