使组合框的下拉菜单更短? [英] Make the dropdown of a combobox be shorter?
问题描述
有点困惑.我有一个数据绑定到字符串列表的组合框.在过去,我记得如果我只有一两个东西,组合框就会很短.但是现在组合框大约是 5 个项目的高度,即使少于 5 个项目(空白下拉框的高度).我需要改变什么来解决这个问题?我玩过 Maxdropdown,没有任何变化.
Mildly confused. I have a combobox that is databound to a list of strings. In the past I recall the combobox being short if I only had one or two things in it. But now the combobox is about the height of 5 items, even when there's less than 5 items (the height of a blank drop down). What do I need to change to fix this? I've played with Maxdropdown with no changes.
推荐答案
您可以覆盖 Template
,如果您的控件已经使用 costom 模板设置样式,则 MaxDropDownHeight
属性可能是模板内没有正确绑定,在这种情况下更改它不会做任何事情.
You can override the Template
, if your control is already styled with a costom template it could be the case that the MaxDropDownHeight
property is not properly bound inside the template, in this case changing it will not do anything.
这篇关于使组合框的下拉菜单更短?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!