Style ScreenTip vertical offset

Ribbon for WPF Forum

Posted 12 years ago by Jeff Jo
Version: 11.1.0545
Avatar
I am using a ribbon control as follows:

<ribbon:Group Label="View">
  <ribbon:Button ImageSourceLarge="images/zoomIn32.png" Label="Zoom In" Click="zoomIn_Click" ScreenTipHeader="Zoom In"/>
</ribbon:Group>
The ScreenTip shows up fine, however it is displayed too far down on the screen. I would like to move it up vertically. I have tried applying a TranslateTransform to the LayoutTrasnform property of the implicit style for ScreenTip:

<Style TargetType="{x:Type ribbon:ScreenTip}">
  <Setter Property="LayoutTransform">
    <Setter.Value>
      <TranslateTransform Y="-100"/>
    </Setter.Value>
  </Setter>
</Style>
I have also tried to set the VerticalOffset. Both techniques do not work. I cannot use the ToolTip property on the ribbon:Button due to other constraints of the application.

Any help would be greatly appreciated!

Comments (4)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jeff,

The screen tip should be showing in the correct location per the Microsoft ribbon specs, right under the ribbon (I pasted your sample XAML in a ribbon here). I'm sorry but it can't really be moved since that would violate Microsoft's licensing requirements, which dictate where it needs to be.


Actipro Software Support

Posted 12 years ago by Jeff Jo
Avatar
That makes sense regarding the Microsoft licensing issues - thanks for the information.

Let me post a different question which relates to normal ToolTips on ribbon buttons. My application has a feature that allows users to change the zoom level which scales all the visual elements in the application. We also require that tooltips be scaled according to the user-specified zoom level. I use the following style to scale tooltips based on the zoom preference.

<Style TargetType="{x:Type ToolTip}">
  <Setter Property="LayoutTransform">
    <Setter.Value>
      <ScaleTransform 
        ScaleX="{Binding Source={x:Static Member=mw:ZoomManager.Instance}, Path=ZoomScaleAmount}" 
        ScaleY="{Binding Source={x:Static Member=mw:ZoomManager.Instance}, Path=ZoomScaleAmount}"/>
    </Setter.Value>        
  </Setter>
</Style>
The binding in the above code simply binds to a singleton which contains the scale amount.

Then all I have to do is specify the tooltip normally on a control:

<TextBox Name="tbValue" ToolTip="Enter a value"/>
The above code works on tooltips that are attached to vanilla WPF controls like TextBoxes:


When I use the ToolTip attribute on a ribbon button, however, the tooltip displays as if it never was scaled:

<ribbon:Group Label="View">
  <ribbon:Button ImageSourceLarge="images/zoomIn32.png" Label="Zoom In" Click="zoomIn_Click" ToolTip="Zoom In"/>
</ribbon:Group>
Any ideas why the layout transform is not applied to the ribbon button's tooltip?

Thanks!
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jeff,

I tried hardcoding the ScaleX/Y values in the implicit Style and in v2011.2 at least, it seemed to pick it up in the ribbon:Button's ToolTip.

If you think there is a problem somewhere, please make a new simple sample project that shows it and email that to our support address. Rename the .zip file extension so it doesn't get spam blocked. Then we can give you some more info.


Actipro Software Support

Posted 12 years ago by Jeff Jo
Avatar
My mistake. I found out that we were overriding the ribbon's tooltip style in the ControlTemplate of ribbon. Everything is working now. Thanks for pointing me in the right direction.
The latest build of this product (v24.1.2) was released 14 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.