WPF ToolBar:如何在设计时排列工具栏

发布于 2024-09-19 16:24:01 字数 311 浏览 1 评论 0原文

我在一个 ToolBarTray 中有两个 Wpf ToolBar。如何使它们适合两行?

我注意到用户可以在运行时移动它们。有没有办法在设计时获得相同的行为而不使用两个 ToolBarTrays ?



总而言之,在启动时,我想要这样:

alt text

而不是:

alt text

谢谢

I've got two Wpf ToolBars in a single ToolBarTray. How to make them fit on two rows?

I noticed users can move them at run-time. Is there a way to get the same behavior at design-time without using two ToolBarTrays ?

To sumarize, at startup, I want this:

alt text

instead of that:

alt text

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对不⑦ 2024-09-26 16:24:01

使用 Band 和 BandIndex 控制工具栏布局。

    <ToolBarTray Background="White">
        <ToolBar Band="1" BandIndex="1">
            <Button Content="B1"/>
            <Button Content="B2"/>
            <Button Content="B3"/>
        </ToolBar>
        <ToolBar Band="2" BandIndex="1">
            <Button Content="B4"/>
            <Button Content="B5"/>
        </ToolBar>
        <ToolBar Band="2" BandIndex="2">
            <Button Content="B6"/>
            <Button Content="B7"/>
        </ToolBar>
    </ToolBarTray>

Use Band and BandIndex to control toolbar layout.

    <ToolBarTray Background="White">
        <ToolBar Band="1" BandIndex="1">
            <Button Content="B1"/>
            <Button Content="B2"/>
            <Button Content="B3"/>
        </ToolBar>
        <ToolBar Band="2" BandIndex="1">
            <Button Content="B4"/>
            <Button Content="B5"/>
        </ToolBar>
        <ToolBar Band="2" BandIndex="2">
            <Button Content="B6"/>
            <Button Content="B7"/>
        </ToolBar>
    </ToolBarTray>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文