From 8d981843e491fa31f96386cbd3db1a71e93fad50 Mon Sep 17 00:00:00 2001 From: KB Bot Date: Thu, 21 Nov 2024 14:49:21 +0000 Subject: [PATCH 1/2] Added new kb article add-vertical-separator-radmenu-winforms --- ...add-vertical-separator-radmenu-winforms.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 knowledge-base/add-vertical-separator-radmenu-winforms.md diff --git a/knowledge-base/add-vertical-separator-radmenu-winforms.md b/knowledge-base/add-vertical-separator-radmenu-winforms.md new file mode 100644 index 000000000..2022e65cf --- /dev/null +++ b/knowledge-base/add-vertical-separator-radmenu-winforms.md @@ -0,0 +1,45 @@ +--- +title: Adding a Vertical Separator to RadMenuItem in RadMenu for WinForms +description: Learn how to insert a vertical separator between menu items in RadMenu for WinForms applications. +type: how-to +page_title: How to Insert a Vertical Separator in RadMenu for WinForms +slug: add-vertical-separator-radmenu-winforms +tags: menus,radmenu, winforms, separator, menuitem, vertical +res_type: kb +ticketid: 1668864 +--- + +## Environment + +|Product Version|Product|Author| +|----|----|----| +|2024.4.1113|RadListView for WinForms|[Dinko Krastev](https://www.telerik.com/blogs/author/dinko-krastev)| + +## Description + +In the following example, we will demonstrate how you can add a vertical separator in the RadMenu control. + +## Solution + +To add a vertical separator to a RadMenu, use the `RadMenuSeparatorItem` class. You can customize the separator's orientation. The following code snippet demonstrates how to insert a vertical separator item between RadMenuItems upon form load. Ensure to adjust the index in the `Items.Insert` method according to where you want to place the separator in your menu. + +````C# +private void Form1_Load(object sender, EventArgs e) +{ + var menuSeparatorItem = new Telerik.WinControls.UI.RadMenuSeparatorItem(); + + menuSeparatorItem.Name = "myPanel_Menu_Sep1"; + menuSeparatorItem.SeparatorOrientation = Telerik.WinControls.SepOrientation.Vertical; + menuSeparatorItem.BackColor = Color.Red; + menuSeparatorItem.ShouldPaint = true; + menuSeparatorItem.TextVisibility = Telerik.WinControls.ElementVisibility.Visible; + radMenu1.Items.Insert(1, menuSeparatorItem); +} +```` + +This approach allows you to dynamically add a vertical separator to your RadMenu, enhancing the menu's visual structure and organization. + +## See Also + +- [RadMenu Overview](https://docs.telerik.com/devtools/winforms/controls/menu/radmenu/overview) +- [RadMenuSeparatorItem Class](https://docs.telerik.com/devtools/winforms/api/telerik.wincontrols.ui.radmenuseparatoritem) From 54d942ab7a560e8711ae16751d0f911da70dbd8d Mon Sep 17 00:00:00 2001 From: Dinko Krastev Date: Mon, 25 Nov 2024 14:37:43 +0200 Subject: [PATCH 2/2] Add Image --- .../add-vertical-separator-radmenu-winforms.md | 2 ++ ...dd-vertical-separator-radmenu-winforms001.png | Bin 0 -> 1155 bytes 2 files changed, 2 insertions(+) create mode 100644 knowledge-base/images/add-vertical-separator-radmenu-winforms001.png diff --git a/knowledge-base/add-vertical-separator-radmenu-winforms.md b/knowledge-base/add-vertical-separator-radmenu-winforms.md index 2022e65cf..c66fe4986 100644 --- a/knowledge-base/add-vertical-separator-radmenu-winforms.md +++ b/knowledge-base/add-vertical-separator-radmenu-winforms.md @@ -19,6 +19,8 @@ ticketid: 1668864 In the following example, we will demonstrate how you can add a vertical separator in the RadMenu control. +![WinForms RadMenu Vertical Separator](images/add-vertical-separator-radmenu-winforms001.png) + ## Solution To add a vertical separator to a RadMenu, use the `RadMenuSeparatorItem` class. You can customize the separator's orientation. The following code snippet demonstrates how to insert a vertical separator item between RadMenuItems upon form load. Ensure to adjust the index in the `Items.Insert` method according to where you want to place the separator in your menu. diff --git a/knowledge-base/images/add-vertical-separator-radmenu-winforms001.png b/knowledge-base/images/add-vertical-separator-radmenu-winforms001.png new file mode 100644 index 0000000000000000000000000000000000000000..9c98bf3e769e30d5a5889df8f876bf31988eac9d GIT binary patch literal 1155 zcmV-}1bq96P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1Q5<_&p5Ok(3X52to`f2to`fhywZZ=8a0EyigEDBE>*Klo|@6NM65=5-BYd zM1e45DnArNkuYQ`JsApOg;BeW(JDT#pwjczl}-GfxYiztyYj$%kG$~Ft5mS1dt1rR zLp%@Lt9KW6SLsmW?@7KMVmSEMII9r`K?4n)%^PXNENvGJ$`tT)!66j6hIn$e_ie=oVNd3Ud-ieBwc%8knCTLQn7P_< zJ)-TXh3Gweqm6ab@_y6pZ{{^}hH{5uvUJ7s@%6phlI2FfGYT=%LnhjOU)x_VXRxcc z0?CRk9%6_I&c#f4iI!!dbs4#-FkGM?Xjd#d=LYC6^fhOR?j1`@>Tv8XE@ET)Qw05v zC^eAvd<4$5D-6egySDxi?$puco`?bt`!MBfE*^t77SCU{VC~t~q94Gms2fFI^chAU z9>A-wUsc)-ZJ%m;As#pAqjRS-*|0?r9!?GSbUPaz3&YQ_ycT8GVy5v<#h^vEpx!}0 z!Hd;9eFRh4Bcb|1fab}Ds%1U1E{@}wLryEfl{UVI@tN**-GMh-LNRN4(~zsvS&4JXATMW)NLBz+Ab2V_vgLMvOUUb4ChqLVbN6Ex+_=Fc&) zjX^Z=#?h=1r<^*gD6*{$UVi(g(%#VacaUP3I^wxls5y`-2xWY`s$bm4R0vyQoix!H zPIVk8@GlbFw#0(C6iube&oYoTEwnWv@*b?)JdM?K{y2rX6kJZVu`k9YQd+SzW-4XF`ys*1hTN!fTwkvIKAVaRTEp*zl;C=}F1EB(W`{9E+{`mY^ z9ZC5}Uqg`0I5cD;#X~_9Ns+%)lY2oy6bL;;`Jo_+M2dleC^ZyBkx&q&hk_`OmtVf9 zM9K@dT?>T&m#O?5-Q3(z5QJzLG7(}xK@eg