TtT23
TtT23

Reputation: 7030

How to set the orientation of menu items to the right?

How do I make a certain menuitem's horizontal alignment set to right like the following?

enter image description here

Setting HorizontalAlignment="Right" in XAML wasn't the answer. Anyone know how?

Upvotes: 1

Views: 392

Answers (1)

Anton Sizikov
Anton Sizikov

Reputation: 9250

Does this layout help you?

   <Menu Height="20" >
                <Menu.ItemsPanel>
                    <ItemsPanelTemplate>
                        <DockPanel HorizontalAlignment="Stretch"/>
                    </ItemsPanelTemplate>
                </Menu.ItemsPanel>
                <MenuItem Header="File">
                    <MenuItem Header="three"/>
                </MenuItem>
                <MenuItem Header="Edit">
                    <MenuItem Header="two"/>
                </MenuItem>
                <MenuItem Header="Tools">
                    <MenuItem Header="one"/>
                </MenuItem>
                    <MenuItem Header="Help" HorizontalAlignment="Right">
                        <MenuItem Header="zero"/>
                    </MenuItem>
            </Menu>

Looks as your example.

Upvotes: 2

Related Questions