如何在 WPF 的功能区中隐藏快速访问工具栏?
how do you hide Quick Access Toolbar in a WPF's Ribbon?
推荐答案当 Ribbon 控件位于 RibbonWindow 中时,快速访问工具栏会自动隐藏.如果不是,则似乎无法隐藏它.我已经在这个问题上工作了几个小时,但无法正确隐藏它.但是有一个简单的解决方法:将 Ribbon 控件放在面板内部,并为其设置一个负的上边距,这样它就会滑出面板.将面板的 ClipToBounds 属性设置为 true,QAT 将被隐藏.顺便说一句 - WPF 有多个 Ribbon 实现,甚至是 Microsoft 自己的(Fluent Ribbon" 和MicrosoftRibbon for WPF"),所以下次你应该提到你在谈论哪一个.
The Quick Access Toolbar is automatically hidden when the Ribbon control is in a RibbonWindow. When it is not, it seems impossible to hide it. I have already worked hours on this issue and was unable to hide it properly. But there is one simple workaround: Place the Ribbon control inside of a Panel and give it a negative top margin so it will slide outside of the Panel. Set the Panel's ClipToBounds property to true and the QAT will be hidden. By the way - there are multiple Ribbon implementations for WPF, even by Microsoft themselves ("Fluent Ribbon" and "Microsoft Ribbon for WPF"), so next time you should mention which one you are talking about.
更多推荐
WPF 功能区
发布评论