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

Inform user why an element is disabled on mouse hover

1 Answer 31 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Mihajlo
Top achievements
Rank 1
Mihajlo asked on 28 Aug 2018, 04:32 PM
In my ribbon bar I can disable some elements on various occasions, and I would like to inform the user about the reason an element is disabled. Usually I would use a tooltip (and some extra code to enable tooltips even for disabled WinForms Controls). But ribbon bar elements are not WinForms controls, and also I don't know how to find a ribbon bar element at cursor's location. Do you have an idea how to inform the user about why the element is disabled when the user hovers the mouse over it?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 29 Aug 2018, 09:29 AM
Hello Mihajlo,

It is possible to show a custom tooltip when hovering over a disabled button. Here is an example that shows this:
RadToolTip toolTip = new RadToolTip();
RadButtonElement prevElement = null;
private void RadRibbonBar1_MouseMove(object sender, MouseEventArgs e)
{
    var element = radRibbonBar1.ElementTree.GetElementAtPoint(e.Location) as RadButtonElement;
    if (e.Button == MouseButtons.None && element != null && !element.Enabled)
    {
        if (prevElement != element)
        {
            toolTip.Show("Disabled because...", Cursor.Position, 2000);
        }
        prevElement = element;
    }          
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RibbonBar
Asked by
Mihajlo
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or