WPF SideBar Menu in VB.NET

This article helps you to learn how to create SideBar Menu in WPF Application.
  • 6029

You can apply different styles to your menu items like designing a SideBar menu. You can create it by supplying a StackPanel for the ItemsPanel property changing its background, and wrapping the entire Menu in a ScrollViewer. Lets see the code snippets to learn how to create a SideBar Menu in WPF Application.

SideBar Menu

<Window x:Class="MenusAndToolbars.SidebarMenu"
    Title="SidebarMenu" Height="300" Width="400">
    <DockPanel LastChildFill="True" Margin="5">
        <Border BorderBrush="SteelBlue" BorderThickness="1">
            <ScrollViewer DockPanel.Dock="Left">
                            <StackPanel Background="White"></StackPanel>
                    <MenuItem Header="File">
                        <MenuItem Header="New"></MenuItem>
                        <MenuItem Header="Open"></MenuItem>
                        <MenuItem Header="Save"></MenuItem>
                    <MenuItem Header="Edit">
                        <MenuItem Header="Cut"></MenuItem>
                        <MenuItem Header="Copy"></MenuItem>
                        <MenuItem Header="Paste"></MenuItem>
                    <MenuItem Header="Help">
                        <MenuItem Header="How do I"></MenuItem>
                        <MenuItem Header="Search"></MenuItem>
                        <MenuItem Header="Index"></MenuItem>
                    </MenuItem>                    </Menu>
        <TextBox Margin="5,0,0,0" TextWrapping="Wrap">Other content goes here.</TextBox>



I hope this will help you.


More Articles

© 2020 DotNetHeaven. All rights reserved.