Skip to content

Commit b09c37c

Browse files
author
KB Bot
committed
Added new kb article dropdownbutton-display-svg-image
1 parent f623679 commit b09c37c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Displaying RadDropDownButton as an SVG Image in WinForms
3+
description: Learn how to display RadDropDownButton as an SVG image.
4+
type: how-to
5+
page_title: How to Display RadDropDownButton as an SVG Image in WinForms
6+
slug: dropdownbutton-display-svg-image
7+
tags: buttons, winforms, svg image, dropdownbutton, customization
8+
res_type: kb
9+
ticketid: 1677727
10+
---
11+
12+
## Environment
13+
14+
|Product Version|Product|Author|
15+
|----|----|----|
16+
|2025.1.211|RadTreeView for WinForms|[Dinko Krastev](https://www.telerik.com/blogs/author/dinko-krastev)|
17+
18+
## Description
19+
20+
In the following scenario, we will demonstrate how to customize a Telerik RadDropDownButton control to look like an SVG image and then display a drop-down menu with items.
21+
22+
## Solution
23+
24+
To achieve this functionality, we can set several properties of the control:
25+
26+
````C#
27+
// Hide the arrow part of the RadDropDownButton
28+
this.radDropDownButton1.ShowArrow = false;
29+
30+
//Remove the text from the RadDropDownButton
31+
this.radDropDownButton1.Text = "";
32+
33+
//Set the background color to transparent
34+
this.radDropDownButton1.BackColor = System.Drawing.Color.Transparent;
35+
36+
//Assign an SVG image to the RadDropDownButton
37+
this.radDropDownButton1.SvgImageXml = resources.GetString("radDropDownButton1.SvgImageXml");
38+
39+
//Add clickable items to the RadDropDownButton's dropdown using RadMenuItems**:
40+
this.radDropDownButton1.Items.AddRange(new Telerik.WinControls.RadItem[] {
41+
this.radMenuItem1,
42+
this.radMenuItem2,
43+
this.radMenuItem3,
44+
this.radMenuItem4,
45+
this.radMenuItem5
46+
});
47+
48+
````
49+
50+
This approach allows you to display an SVG image while providing a list of clickable items.
51+
52+
## See Also
53+
54+
- [RadDropDownButton Documentation](https://docs.telerik.com/devtools/winforms/controls/buttons/dropdownbutton/dropdownbutton)

0 commit comments

Comments
 (0)