# Styling and Themes

## Content

You can change the appearance of the menu in two ways. Apply a ComponentOne theme to restyle the menu together with the other controls on the form, or use the `Styles` property to adjust the borders, fonts, padding, colors, and badges of the menu directly.

***

## Apply a Theme

`C1ThemeController` applies the theme you choose to the menu and to the other supported ComponentOne controls in the control tree. As a result, the whole form keeps a consistent appearance.
The following example applies a theme to the controls in a form or user control:

```csharp
using C1.Win.Themes;

internal void ApplyTheme(C1Theme theme)
{
    C1ThemeController.ApplyThemeToControlTree(this, theme);
}
```

>type=note
> **<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1">Note:</span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1"> </span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1">ApplyStyle</span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1"> and </span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1">ThemeChanged</span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1"> provide lower-level theming support. Most applications should apply themes through </span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1">C1ThemeController</span>**<span data-loadable-vc-wrapper="true" data-ssr-placeholder-replace="Hm6N8:EfLS5:z8NN7:qz-Pe:OP-5u-1">.</span>

***

## Customize Menu Styles

Use the [Styles](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.C1HamburgerMenu.Styles.html) property to configure the borders, fonts, padding, state colors, and badge appearance of the menu.
The following example sets the border, font, and padding of the toggle button, the items, and the active item, and sets the badge shape for three item states. The example needs the `System.Drawing` and `C1.Framework` namespaces.

```csharp
var font = new Font(new FontFamily("Arial"), 12, FontStyle.Bold, GraphicsUnit.Pixel);

menu.Styles.Common.ShowBorder = true;

menu.Styles.ToggleButton.Border = 1;
menu.Styles.ToggleButton.Font = font;
menu.Styles.ToggleButton.Padding = new Thickness(8);

menu.Styles.Items.Border = 1;
menu.Styles.Items.Font = font;
menu.Styles.Items.Padding = new Thickness(8);

menu.Styles.ActiveItem.Border = 1;
menu.Styles.ActiveItem.Font = font;
menu.Styles.ActiveItem.Padding = new Thickness(8);

menu.Styles.Items.Default.Badge.Shape = BadgeShape.RoundedRectangle;
menu.Styles.Items.Hot.Badge.Shape = BadgeShape.Circle;
menu.Styles.Items.Disabled.Badge.Shape = BadgeShape.RoundedRectangle;
```

The following table describes the available style groups:

| Style | @cols=2:Applies To |
| ----- | ---------- | ---------- |
| [Common](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuStyles.Common.html) | The menu container, including its default background, border, and font settings. |
| [Items](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuStyles.Items.html) | Menu items in the `Default`, `Disabled`, `Hot`, `Pressed`, and `Highlighted` states. The `Highlighted` state applies to search matches. |
| [ActiveItem](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuStyles.ActiveItem.html) | The currently selected menu item. |
| [ToggleButton](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.C1HamburgerMenu.ToggleButton.html) | The hamburger button in the `Default`, `Disabled`, `Hot`, and `Pressed` states. |
| `Items.<state>.Badge` | Item badges. This style configures badge shape, font, border, and colors. |
| `Items.<state>.Parent` | Menu items that contain child items. |

Set the menu-level [BackColor](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.C1HamburgerMenu.BackColor.html) property to change the menu background. Use `BackColor` and [ForeColor](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.BaseTextItemStyle.ForeColor.html) within a style state to configure state-specific colors. Badge styles also expose [BorderColor](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.BaseItemStyle.BorderColor.html).
Properties shared across all states, such as [Border](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuItemStyle.Border.html), [Font](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuStyle.Font.html), and [Padding](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuStyle.Padding.html), are set on the style group. State-specific colors are configured on the corresponding state. `Padding` and [Margin](/componentone/api/win/online-hamburger-menu/dotnet-api/C1.Win.Command.HamburgerMenu.10/C1.Win.Command.HamburgerMenu.Styles.HamburgerMenuStyle.Margins.html) use `C1.Framework.Thickness` values, and `Border` specifies the border thickness.