【问题标题】:radbuttontelerik/winform/c#: how to remove border of the icon?radbutton telerik/winform/c#:如何删除图标的边框?
【发布时间】:2021-01-05 15:59:00
【问题描述】:

我有这个搜索器

我想去掉玻璃的边框。

c#Winform中的RadButtonTextBox

我尝试修改文本框的颜色,但没有得到我需要的:

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

我该怎么做?

【问题讨论】:

    标签: c# winforms telerik radbuttontextbox


    【解决方案1】:

    消除右键元素周围边框的最简单方法是操作其 Visibility 属性:

            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);
    

    【讨论】:

      【解决方案2】:

      Property ShouldPaint 就是答案:

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

      【讨论】:

        猜你喜欢
        • 2018-03-01
        • 1970-01-01
        • 2013-07-08
        • 2022-01-14
        • 1970-01-01
        • 2021-03-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多