This is a migrated thread and some comments may be shown as answers.

Change Image When Disabled

1 Answer 86 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Russ
Top achievements
Rank 1
Russ asked on 08 Oct 2009, 02:48 PM
What is the best way (or is there a way) to swap images when a RadImageButtonElement is on the ribbonbar.  We would also like to keep the text the same color but have the control be disabled with a different image.

Russ

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 14 Oct 2009, 07:24 AM
Hello Russ,

Thank you for writing.

You can swap images in RadImageButtonElement EnabledChanged event. If you want to discard the default disabled paint you have to set UseDefaultDisabledPaint to false. Please, consider the following code:

this.radImageButtonElement1.UseDefaultDisabledPaint = false;
 
void radImageButtonElement1_EnabledChanged(object sender, EventArgs e)
{
    if (this.radImageButtonElement1.Enabled)
    {
        this.radImageButtonElement1.Image = global::ButtonImageAlignment.Properties.Resources.enabledImg;
    }
    else
    {
        this.radImageButtonElement1.Image = global::ButtonImageAlignment.Properties.Resources.disabledImg;
    }
}

Do not hesitate to contact me again if you have other questions.

All the best,
Martin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
RibbonBar
Asked by
Russ
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or