Hi
We are using Infragistics.Win.Misc.UltraButton v12.1 and we make the button enabled / disabled in code. I have a problem
Background:
Idea is when enabled Button is shown as grey and when enabled as white. It works in almost all cases.
private void InitializeComponent() { Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance(); Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance(); this.ultraButton1 = new Infragistics.Win.Misc.UltraButton(); this.SuspendLayout(); // // ultraButton1 //
appearance4.BorderAlpha = Infragistics.Win.Alpha.Transparent; appearance4.ForeColorDisabled = System.Drawing.Color.DimGray; appearance4.Image = global::ThermoControls.Properties.Resources.grid_delete; appearance4.ImageBackground = global::ThermoControls.Properties.Resources.toggle_button; // the white button appearance4.ImageBackgroundAlpha = Infragistics.Win.Alpha.Opaque; appearance4.ImageBackgroundDisabled = global::ThermoControls.Properties.Resources.toggle_button_disabled; // the grey button appearance4.ImageHAlign = Infragistics.Win.HAlign.Center; this.ultraButton1.Appearance = appearance4;
But then on one occasion when I put the ultraButton1.Enabled to true the button remains grey.
I am also kind of surprised the ultraButton1.appearance4.ImageBackground is not constant after the InitializeComponent() is called when I watch it in Watch window.
Jukka
Hi Jukka,
Can you post a small sample project demonstrating the problem? There's no reason why the control should continue to display as disabled when it's enabled. If that's happening, then it's most likely a bug.
Jukkaaakula said:I am also kind of surprised the ultraButton1.appearance4.ImageBackground is not constant after the InitializeComponent() is called when I watch it in Watch window.
I don't understand what you mean by "not constant." The control will never change this property setting internally. If it's changing, then something in your code must be changing it.
Thank you, Mike
"I don't understand what you mean by "not constant." The control will never change this property setting internally. If it's changing, then something in your code must be changing it."
So this is never changed e.g. when the Enabled property is changed from false to true ?
Well... the image might display differently - the control grays it out so that it looks disabled. But the property/image itself is not changed. If you get the image out of the property, you will get the same image you put in.
If you don't want the image to be displayed grayed out, then assign the same image to both ImageBackground and ImageBackgroundDisabled.
Hi Mike
The problem was in some way connected to the fact that a control had children, one of those childrens being non enabled. When I made the child control enabled the problem was solved.
Thank you for your help.