WPF:可编辑的组合框会掉落?
我正在尝试创建一个既可编辑又可下拉而不是下拉的组合框。按向上箭头键(默认为向下键)时也应打开菜单。
我尝试修改 ComboBox 的默认 ControlTemplate 但它似乎不支持 IsEditable?
Im trying to create a ComboBox thats both editable and drops up instead of down. The menu should also open when pressing the up-arrow-key (down by default).
I have tried modifying the default ControlTemplate for ComboBox but it doesn't seem to have any support for IsEditable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认的
ControlTemplate
不适用于IsEditable = true
品种,但该样式包含一个触发器,可在设置 IsEditable 时更改它:它将其更改为另一个
ControlTemplate< /code> 其中相关部分是弹出窗口:
我认为您应该能够将
Placement
属性更改为Top
。The default
ControlTemplate
is not for theIsEditable = true
variety, but the style contains a trigger that changes it when IsEditable is set:It changes it to another
ControlTemplate
where the relevant part is the popup:I think you should just be able to change the
Placement
property toTop
.