Over a million developers have joined DZone.

Silverlight ToolTips – Positioning and Customizing

DZone's Guide to

Silverlight ToolTips – Positioning and Customizing

· ·
Free Resource


The end all be all definitive guide on how to customize a ToolTip is Dave Relyea’s post.  He shows a very clean and concise step by step on how to completely change the visuals of a ToolTip.  http://blogs.msdn.com/devdave/archive/2008/10/18/customizing-a-tooltip.aspx


Positioning a ToolTip can be done with HorizontalOffset and VerticalOffset.  The biggest drawback is the inability to place the tooltip exactly where you want through XAML.  It can be done by wiring up a MouseEnter event for the ToolTip and then calculating the offsets.

<Button x:Name="InfoButton" Content="info" Width="50" Height="25">


<ToolTip HorizontalOffset="-40" VerticalOffset="-140">


<Grid Width="70">

<Rectangle Fill="Blue" />

<TextBlock TextWrapping="Wrap" Foreground="White"
Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam mattis," />






Notice the nested ToolTip inside the ToolTipService.  This is where you set the horizontal and vertical offsets for the Tooltip.



Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}