Dave
Dave

Reputation: 7359

radbuttontelerik/winform/c#: how to remove border of the icon?

I have this searcher

enter image description here

I would like to remove the border of the glass.

It is a RadButtonTextBox in Winform in c#.

I thried modifing the colors of textbox and I didn't get what I need:

this.radtxtFilter.RightButtonItems[0].EnableBorderHighlight = false;
this.radtxtFilter.RightButtonItems[0].BorderHighlightColor = System.Drawing.Color.Red;

How can I do it?

Upvotes: 0

Views: 144

Answers (2)

Dave
Dave

Reputation: 7359

Property ShouldPaint is the answer:

RadButtonElement radButtonElement = new RadButtonElement();
radButtonElement.ImagePrimitive.Image = Resources.TV_search;
radButtonElement.BorderElement.ShouldPaint = false;
this.radtxtFilter.RightButtonItems.Add(radButtonElement);

Upvotes: 0

Dess
Dess

Reputation: 484

The easiest way to eliminate the border around the right button element is to manipulate its Visibility property:

        RadButtonElement radButtonElement = new RadButtonElement();
        radButtonElement.Text = "";
        radButtonElement.DisplayStyle = Telerik.WinControls.DisplayStyle.Text;
        radButtonElement.TextElement.CustomFont = "TelerikWebUI";
        radButtonElement.TextElement.CustomFontSize = 10;

        radButtonElement.BorderElement.Visibility = ElementVisibility.Collapsed;

        this.radButtonTextBox1.RightButtonItems.Add(radButtonElement);

enter image description here

Upvotes: 1

Related Questions