Change Image When Disabled

2 posts, 0 answers
  1. Russ
    Russ avatar
    48 posts
    Member since:
    Sep 2006

    Posted 08 Oct 2009 Link to this post

    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.

  2. Martin Vasilev
    Martin Vasilev avatar
    1061 posts

    Posted 14 Oct 2009 Link to this post

    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;
            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.
  3. DevCraft banner
Back to Top