如何更改Telerik RadButton背景色?如何更改Telerik RadButton背景色与c#
你可以改变背景色或前景色为System.Windows.Forms.Button
,但它不是Telerik.WinControls.UI.RadButton
工作。
与Telerik.WinControls.UI.RadDropDownButton
由于
如何更改Telerik RadButton背景色?如何更改Telerik RadButton背景色与c#
你可以改变背景色或前景色为System.Windows.Forms.Button
,但它不是Telerik.WinControls.UI.RadButton
工作。
与Telerik.WinControls.UI.RadDropDownButton
由于
的Telerik的radbutton的背景相同的问题是由fill primitive
限定。 要更改其属性,请打开Edit UI Elements
,FillPrimitive
并更改BackColor
属性。
更改背面颜色与代码:
using Telerik.WinControls.Primitives;
((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof(FillPrimitive))[0]).BackColor = Color.FromArgb(241, 241, 231);
((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof(FillPrimitive))[0]).BackColor2 = Color.FromArgb(227, 227, 212);
((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof(FillPrimitive))[0]).BackColor3 = Color.FromArgb(209, 208, 187);
((FillPrimitive)radButton1.ButtonElement.GetChildrenByType(typeof运算(FillPrimitive))[0])= BackColor4 Color.FromArgb(229,229,213);
您还可以使用FillPrimitive
的NumberOfColors
属性修改渐变中的颜色数。
请记住,应用背景色一样,将覆盖从Telerik的主题来任意设置背景色。
如果我没有记错的话,你应该重写默认主题。也许将'EnableTheming'属性设置为'false'。尝试在官方telerik页面上找到一些教程。 – Nino
@Nino我试过'EnableTheming = false;'不工作。 – aghilpro