Hello, Jiang,
When you don't apply the Material theme to the entire application and use the
ControlDefault theme, indeed, the custom image button doesn't have hover effect. Both themes have different style applied to the system buttons in the title-bar. The
ControlDefault theme uses different images, not colors for the element states. That is why you are not obtaining the desired hove indication.
The possible solution that I can suggest for the
ControlDefault theme is to use a
RadButtonElement instead of
RadImageButtonElement. Please refer to the code snippet below:
RadButtonElement systrayButton =
new
RadButtonElement();
systrayButton.Image = Properties.Resources.info;
systrayButton.DisplayStyle = Telerik.WinControls.DisplayStyle.Image;
systrayButton.AutoSize =
false
;
systrayButton.Size =
this
.FormElement.TitleBar.MinimizeButton.Size;
systrayButton.Click += systrayButton_Click;
systrayButton.SetThemeValueOverride(Telerik.WinControls.Primitives.BorderPrimitive.ForeColorProperty,
Color.Transparent,
""
,
typeof
(Telerik.WinControls.Primitives.BorderPrimitive));
systrayButton.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.BackColorProperty,
Color.Transparent,
""
,
typeof
(Telerik.WinControls.Primitives.FillPrimitive));
systrayButton.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.GradientStyleProperty,
GradientStyles.Solid,
""
,
typeof
(Telerik.WinControls.Primitives.FillPrimitive));
this
.FormElement.TitleBar.Children.Last().Children.Insert(0, systrayButton);
I hope this information helps.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.