SplitButton ScreenTip

Ribbon for WPF Forum

Posted 14 years ago by Norbert Gesell
Version: 10.1.0521
Avatar
Hello,

as the "Microsoft Vista UX Guidelines" suggests to use different screentips for the command and the popup portion of a splitbutton control, I am wondering how to achieve this with a RibbonSplitButton. The 'ScreenTipDescription' property seems to be used for both elements.

Can you help me with this issue?

Regards,
Detlef Peters (for N. Gesell's team)

Comments (10)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Norbert,

We don't have a way to do that at the moment, but I will make sure there is a TODO item added for it. I'll keep track of this post with that TODO item so that we can notify you when we implement it.


Actipro Software Support

Posted 1 year ago by Lars Klose
Avatar

Found this request while looking for the same feature. Is this still not available?

Would it be possible to achieve it by modifying the SplitButton template?

[Modified 1 year ago]

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Lars,

We don't have properties to directly set the screen tip content for the separate parts of the split button, but in the original Ribbon product you can handle the ScreenTipOpening event (either in an inherited class as in the sample below, or by handling the event externally) and then update the ScreenTipDescription on the fly based on the IsButtonHighlighted value.

protected override void OnScreenTipOpening(RoutedEventArgs e) {
	if (e.Source is SplitButton splitButton) {
		if (splitButton.IsButtonHighlighted)
			splitButton.ScreenTipDescription = "Over button portion";
		else
			splitButton.ScreenTipDescription = "Over popup portion";
	}

	base.OnScreenTipOpening(e);
}


Actipro Software Support

Posted 1 year ago by Lars Klose
Avatar

Thanks for the suggestion!

Also helped me with avoiding the Tooltip (not Screentip in that case) on a SplitButton Popup Menu.
Is it intentional or a bug that a tooltip defined on the SplitButton is also displayed in the area of the popup menu if its item template has a part where it effectiverly shows no child control (i.e. the popup panel "shines through")?

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you use ScreenTipHeader instead of ToolTip, does the problem go away?  We don't have anything in this older Ribbon that blocks tranditional ToolTips when the popup is open, and ToolTip might be thinking the popup is part of the button's UI to which it is assigned.  By using ScreenTipHeader, you can work around that.


Actipro Software Support

Posted 1 year ago by Lars Klose
Avatar

Well, kind of, the Screentip indeed doesn't show on the popup. However, since I use SplitButton somewhere else outside the ribbon, I only want a simple tooltip-like appearance. That doesn't seem to be possible using ScreenTip as I cannot convince it to only show the description part, even if setting Header and Footer to null explicitly.

I therefore chose to keep using the tooltip but now override OnTooltipOpening to disable it if mouse coordinates are outside the button itself, e.g. over the popup.

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Lars,

You can have the SplitButton.Label set to some text you want to show in UI, and then ScreenTipHeader set to the tooltip text.  If you only specify ScreenTipHeader and not ScreenTipDescription, ScreenTipFooter, etc., then it should render the screentip like a regular tooltip.  


Actipro Software Support

Posted 1 year ago by Lars Klose
Avatar

That's not what I see: if I set only ScreenTipHeader, but not ScreenTipFooter/Description, I get a bold header and the default footer (something along the lines of "Press F1 for help"). This is with version 22.1.0 - did it change later?

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Lars,

If all you set is the ScreenTipHeader to text and don't have a ScreenTipDescription, ScreenTipFooter, ScreenTipHelpUri etc. set, it should render the ScreenTip like a ToolTip.  If any of those ancillary properties are set, it will render more like a ScreenTip with bold header.

You can test this with this code that I updated in the Ribbon "Standalone Controls" QuickStart (I changed ScreenTipDescription to ScreenTipHeader):

<ribbon:SplitButton ImageSourceLarge="/Images/Icons/Save32.png" Label="Large SplitButton" VariantSize="Large" ScreenTipHeader="This SplitButton has a VariantSize of Large.">
...

In that code it looks like a regular ToolTip.

If I then update it to add a ScreenTipHelpUri attribute, I start to see the "Press F1 for help" text too.


Actipro Software Support

Posted 1 year ago by Lars Klose
Avatar

I can reproduce your suggestion in the QuickStart sample, but somehow in our application I always get the "Press F1 for help" as if the button picks up the ScreenTipHelpUri from somewhere, even when I set it explicitly to "{x:Null}"

So I'll just stay with the workaround using the classic Tooltip and OnToolTipOpening.

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.