How do I create a menu separator bar in WPF using code

WPF has a Separator control for just that purpose and it also separates your menu items when the appear on a toolbar. From the MSDN docs:

A Separator control draws a line,
horizontal or vertical, between items
in controls, such as ListBox, Menu,
and ToolBar. Separator controls do not
react to any keyboard, mouse, mouse
wheel, or tablet input and cannot be
enabled or selected.

In code:

using System.Windows.Controls;

//

Menu myMenu = new Menu();
myMenu.Items.Add(new Separator());

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)