Posted 25 February 2020, 10:12 pm EST
Is there any way to find out what the X Y position of a Ribbon item is inside the ribbon (for example, to show the tooltip)?
Forums Home / ComponentOne / WinForms Edition
Posted by: mike on 25 February 2020, 10:12 pm EST
Posted 25 February 2020, 10:12 pm EST
Is there any way to find out what the X Y position of a Ribbon item is inside the ribbon (for example, to show the tooltip)?
Posted 25 February 2020, 10:15 pm EST
Oh - and it is possible to do that for a C1RibbonTextBox because it has a TextBox inside it so the TextBox’s position can be looked at. But not for a C1RibbonButton…
Posted 26 February 2020, 2:36 am EST
Hi Mike,
You can take a look at the attached sample to learn how to show the tooltip in RibbonItems.
Regards,
Prabhat Sharma.
RibbonToolTipDemo.zip
Posted 26 February 2020, 7:38 pm EST
First of all, your example uses ToolTip - I’d like to use C1SuperToolTip. And second, your example just lines it up on the mouse - I could do that with C1SuperToolTip easily, but I would much prefer showing the tooltip either to the right of the button or below it, for which I need to know where the button is…
Posted 27 February 2020, 2:08 am EST
Hello Mike,
I have updated the sample with C1SuperToolTip.
Although there is no way to get the coordinates of the RibbonItem, you can get the mouse position when hoving on the ribbon item and change the position of the SuperToolTip accordingly.
Regards,
Prabhat Sharma.
RibbonToolTipDemo_Mod.zip
Posted 27 February 2020, 12:40 pm EST
Thanks, but you’re saying there is absolutely no way to get the coordinates of the ribbon item?
Even your tooltips that you show for ribbon items in the Ribbon are always shown at the bottom of the ribbon - which really doesn’t look good…
Posted 28 February 2020, 2:34 am EST
Hello Mike,
Sorry for the inconvenience.
Although there is no property or method available in RibbonItem to get its coordinates, you can use the GetItemBounds property of C1Ribbon to get the rectangle of the ribbon item and then use its value to set the position of the SuperToolTip.
https://www.grapecity.com/componentone/docs/win/online-ribbon/C1.Win.Ribbon.4.5.2~C1.Win.Ribbon.C1Ribbon~GetItemBounds.html
I have modified the last sample accordingly, please have a look.
I hope it helps.
Regards,
Prabhat Sharma.
RibbonToolTipDemo_Mod2.zip
Posted 28 February 2020, 2:52 am EST
Thanks, that’s exactly what I was looking for. Perfect.
Now - wouldn’t it be great if the native C1Ribbon tooltip for the ribbon items used that as the position instead of showing under the ribbon?
Posted 28 February 2020, 3:19 am EST
Hi,
Now - wouldn’t it be great if the native C1Ribbon tooltip for the ribbon items used that as the position instead of showing under the ribbon?
We have escalated this request to the developers and will let you once we get any updates on this from the developers’ end.
[Internal Tracking ID: 422880]
Regards,
Prabhat Sharma.
Posted 11 August 2020, 7:49 am EST
Hello,
PopupToolTip event and PlacementMode property added in the New Ribbon. You can download the same from the following link:
http://prerelease.componentone.com/dotnet452/c1winform/2020-t2/C1WinForms-452_4.5.20202.438.zip
Thanks,
Mohit