namespace System.Windows.Forms { public class ToolStripSeparator : ToolStripItem { private System.Windows.Controls.Separator separator; public override void ApplyStyle(ToolStripProfessionalRenderer r) { separator.Background = r.SeparatorDark; } public ToolStripSeparator(bool vertical = false) { separator = new(); SetControl(separator); separator.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; separator.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; separator.Margin = new Thickness(4); if (vertical) separator.Style = System.Windows.Application.Current.FindResource(System.Windows.Controls.ToolBar.SeparatorStyleKey) as Style; } } }