Click here to Skip to main content
16,020,347 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a form which contains tooltray containing N number for toolbar when i change the Band of any toolbar after that when i change orientation the entire band which i have changed containing toolbar width increased.

HTML
<window x:class="MainWindow" xmlns:x="#unknown">
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
    <window.resources>
        <Style TargetType="Viewbox" x:Key="StyleViewBox">
            <Style.Triggers>
                <trigger property="IsMouseOver" value="True">
                    <setter property="Width" value="100" />
                    <setter property="Height" value="100" />
                </trigger>
            </Style.Triggers>
        </Style>
    </window.resources>
    <grid>
        <grid.rowdefinitions>
            <rowdefinition></rowdefinition>
            <rowdefinition></rowdefinition>
            <rowdefinition></rowdefinition>
        </grid.rowdefinitions>
        <toolbartray x:name="ToolTray" grid.row="0" grid.rowspan="2" removed="SkyBlue">
            <toolbar band="0" bandindex="0">
                <Button Background="Aqua" Height="25" Width="25" >0</Button>
                <Button Background="BlueViolet" Height="25" Width="25" >0</Button>
                <Button Background="CornflowerBlue" Height="25" Width="25">0</Button>
            </toolbar>
            <toolbar band="0" bandindex="1">
                <Button Background="Aqua" Height="25" Width="25">1</Button>
                <Button Background="BlueViolet"  Height="25" Width="25">1</Button>
                <Button Background="CornflowerBlue" Height="25" Width="25">1</Button>
            </toolbar>
            <toolbar band="0" bandindex="2">
                <Button Background="Aqua" Height="25" Width="25">2</Button>
                <Button Background="BlueViolet" Height="25" Width="25">2</Button>
                <Button Background="CornflowerBlue" Height="25" Width="25">2</Button>
            </toolbar>
            <toolbar band="0" bandindex="3">
                <Button Background="Aqua" Height="25" Width="25">3</Button>
                <Button Background="BlueViolet" Height="25" Width="25">3</Button>
                <Button Background="CornflowerBlue" Height="25" Width="25">3</Button>
            </toolbar>
        </toolbartray>
        <Button Grid.Row="2" Height="25" Width="80" Click="Button_Click_1">Orientation</Button>
    </grid>
</window>

----------------------------------------------------------------------

C#
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        If (ToolTray.Orientation = Orientation.Horizontal) Then
            ToolTray.Orientation = Orientation.Vertical
        Else
            ToolTray.Orientation = Orientation.Horizontal
        End If
End Sub
Posted
Updated 26-Feb-15 21:50pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900