You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And that works, it displays in the desired colour.
But when I put the same code in my application, for example in a MouseHover event handler, it returns "{Name=@CMSToolBarButtonBackgroundHover, ARGB=(0, 0, 0, 0)}" which seems right compared to other places, but it has no effect in the UI.
I can change the colour name in InitializeComponent and it changes the initial colour in the UI, I can also change the colour in the event handler to a non-theme colour (eg.FromARGB or Color.Black) but nothing I do in the event handler with the theme defined colour seems to have any effect.
In some cases I can setup buttons and use the theme designer to provide hover effects, but there are instances I need to do this programatically.
Activity
itg-assistant commentedon Jun 12, 2026
Luca answered 2017-04-06 16:08:57 UTC
I added
"colors": {
"CMSToolBarButtonBackgroundHover": "red"
}
to a theme mixin and attached to the mouse hover event like this:
private void Button_MouseHover(object sender, EventArgs e)
{
((Button)sender).BackColor = System.Drawing.Color.FromName("@CMSToolBarButtonBackgroundHover");
}
It works here. I also tried to assign a BackColor to the button to something different than the default. Can you reproduce in a small test case?
Thanks,
Luca