Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF ToolBar: How to arrange toolbars at design-time

Tags:

wpf

toolbar

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

like image 492
tpol Avatar asked Sep 13 '10 16:09

tpol


1 Answers

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>
like image 100
Zamboni Avatar answered Nov 09 '22 20:11

Zamboni