Skip to content

Commit 42d89a7

Browse files
authored
Merge pull request #642 from telerik/new-kb-contextmenu-remove-icon-column-8480b80fc859427da5c5c46724a4f6cf
Added new kb article contextmenu-remove-icon-column
2 parents e639668 + de36406 commit 42d89a7

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Removing the Icon Column in RadContextMenu for WinForms
3+
description: Learn how to hide or remove the icon column in RadContextMenu when items do not have icons, for a cleaner UI in WinForms applications.
4+
type: how-to
5+
page_title: How to Hide the Icon Column in RadContextMenu for WinForms Applications
6+
slug: contextmenu-remove-icon-column
7+
tags: menus, winforms, ui, customization
8+
res_type: kb
9+
ticketid: 1627322
10+
---
11+
12+
## Environment
13+
14+
|Product Version|Product|Author|
15+
|----|----|----|
16+
|2024.3.806|RadContextMenu for WinForms|[Dinko Krastev](https://www.telerik.com/blogs/author/dinko-krastev)|
17+
18+
## Description
19+
20+
In some scenarios, RadContextMenu items in WinForms applications do not have icons. The default layout includes a column for icons, which may be unnecessary and consume space. This article demonstrates how to reduce or hide the icon column in RadContextMenu for a cleaner user interface.
21+
22+
## Solution
23+
24+
To remove or hide the icon column in the RadContextMenu, modify the `LeftColumnMinWidth` property of the `RadDropDownMenuLayout`. Setting this property to `0` effectively hides the space reserved for icons.
25+
26+
Here is a code snippet demonstrating these steps:
27+
28+
````C#
29+
30+
RadDropDownMenuElement element = this.radContextMenu1.DropDown.PopupElement as RadDropDownMenuElement;
31+
RadDropDownMenuLayout layout = element.LayoutPanel as RadDropDownMenuLayout;
32+
layout.LeftColumnMinWidth = 0;
33+
34+
````
35+
36+
This code removes the space on the left side of the drop-down menu that is typically reserved for icons, providing a cleaner look when your menu items do not require icons.
37+
38+
## See Also
39+
40+
- [RadContextMenu Overview](https://docs.telerik.com/devtools/winforms/controls/contextmenu/contextmenu)
41+
- [Customizing RadContextMenu](https://docs.telerik.com/devtools/winforms/controls/contextmenu/customizing-contextmenu)

0 commit comments

Comments
 (0)