WPF RibbonComboBox 高度
好吧,我本以为这是一个简单的问题,但显然这让我感到困惑。
当我尝试设置 RibbonComboBox 的高度时,它并没有移动它的实际大小,只是移动它周围的框。
这是我的 XAML:
<ribbon:RibbonComboBox
DisplayMemberPath="CompanyCode"
Height="22"
Margin="0,0,0,-30"
VerticalAlignment="Bottom"
Width="102">
<ribbon:RibbonGallery SelectedValue="{Binding Path=Companies.SelectedItem,
ValidatesOnDataErrors=true,
NotifyOnValidationError=true }">
<ribbon:RibbonGalleryCategory ItemsSource="{Binding Path=Companies.Items,
NotifyOnValidationError=true,
ValidatesOnDataErrors=true}" />
</ribbon:RibbonGallery>
</ribbon:RibbonComboBox>
我可以将高度更改为 200 或 1,但高度永远不会改变。
我做错了什么?
谢谢, 埃罗克
Ok, I would have thought this was a simple question, but apparently it's got me confused.
When I try to set the height of my RibbonComboBox, it's not moving actual size of it, just the box that surrounds it.
Here is my XAML:
<ribbon:RibbonComboBox
DisplayMemberPath="CompanyCode"
Height="22"
Margin="0,0,0,-30"
VerticalAlignment="Bottom"
Width="102">
<ribbon:RibbonGallery SelectedValue="{Binding Path=Companies.SelectedItem,
ValidatesOnDataErrors=true,
NotifyOnValidationError=true }">
<ribbon:RibbonGalleryCategory ItemsSource="{Binding Path=Companies.Items,
NotifyOnValidationError=true,
ValidatesOnDataErrors=true}" />
</ribbon:RibbonGallery>
</ribbon:RibbonComboBox>
I can change the height to 200 or 1 but the height never changes.
What am I doing wrong?
Thanks,
Eroc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果设置 下拉高度
You can change the height easily if you set the DropDownHeight
高度是硬编码在样式内的。这可能是因为控件必须在功能区环境中运行,这意味着它必须是标准的。
一个简单的技巧是使用
VisualTreeHelper
到达正确的Border
并更改其高度。The Height is Hardcoded inside the style. It's probably because the control must behave in a Ribbon environment, which means it's must be standard.
One simple hack is to reach for the proper
Border
with theVisualTreeHelper
and change his height.