[英]WPF ComboBox with custom dropdown width
Popup is a part of ComboBox template ("PART_Popup"). Popup是ComboBox模板(“PART_Popup”)的一部分。 Add a Style for Popup
to combobox Resources and set appropriate width there. 将Popup
样式添加到组合框资源并在那里设置适当的宽度。
<ComboBox>
<ComboBox.Resources>
<Style TargetType="Popup">
<Setter Property="Width" Value="1000"/>
</Style>
</ComboBox.Resources>
</ComboBox>
note also that there is a binding for Popup.MinWidth in template so you can't make it too small. 另请注意,模板中的Popup.MinWidth存在绑定,因此您无法将其设置得太小。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.