There doesn't seem to be a .Show() kind of method for the Windows.Control.ToolTip, incl in ToolTipService.
6 Answers
What you need to do is make sure the ToolTip on the control is of type ToolTip. Then you can set the IsOpen property to true like so:
ToolTip tooltip = new ToolTip{ Content = "My Tooltip" };
NameTextBox.ToolTip = tooltip;
tooltip.IsOpen = true;

- 45,695
- 27
- 126
- 169
-
Hi Ray, this answer was really helpful. Thanks :) – Priyank Thakkar Mar 11 '12 at 12:11
-
14I would recommend to add `tooltip.StaysOpen = false` :-) – itsho Aug 25 '14 at 13:18
-
1@itsho `StaysOpen` will cause an exception next time mouse hovers over the control. At least this is my case. Subscribe to `Opened` event instead. – Anthony Apr 04 '18 at 11:40
-
Just add `if (!tip.IsOpen) tip.StaysOpen = true;` to avoid the `NotSupportedException` (reset the property when you close the tooltip) – daserge Dec 10 '18 at 10:42
If you would like to control how long the tooltip remains open, you can subscribe to the Opened
event and set a time delay before closing the tooltip.
Subscription has to be done before IsOpen = true
and it has to be an async method to avoid hanging up the UI.
var tooltip = new ToolTip { Content = "New tooltip text" };
MyControln.ToolTip = tooltip;
tooltip.Opened += async delegate (object o, RoutedEventArgs args)
{
var s = o as ToolTip;
// let the tooltip display for 1 second
await Task.Delay(1000);
s.IsOpen = false;
// wait till the close tooltip animation finishes before changing to old tooltip text
await Task.Delay(1000);
s.Content = "Old tooltip text";
};
tooltip.IsOpen = true;

- 3,595
- 2
- 29
- 38
Is showing a tooltip what you really want to do. A tooltip has a clear meaning to most users and an expectation that it goes away when moving the mouse (and can come back when you hover over the item in question).
If your aim is to draw attention to something, have you considered some form of floating box which is fully under your control, WPF makes this easy!

- 14,896
- 8
- 53
- 78
-
Thanks for the additional thoughts on this. Yes, it's for user-input validation. Can you elaborate a bit on the 'floating box' concept? – MrGreggles Oct 01 '09 at 09:59
Finally i ended with this .. and it's working fantastic ..
Popup myPopup = new Popup();
myPopup.PlacementTarget = control; //FrameworkElement where you want to show this tooltip
myPopup.Placement = PlacementMode.Top;
myPopup.PopupAnimation = PopupAnimation.Slide;
myPopup.AllowsTransparency = true;
TextBlock popupText = new TextBlock();
popupText.Text = ErrorMessage; //Message you want to show
popupText.Background = Brushes.AliceBlue;
popupText.Foreground = Brushes.Red;
//popupText.FontSize = 12;
popupText.TextWrapping = TextWrapping.Wrap;
myPopup.Child = popupText;
// popup1.CustomPopupPlacementCallback =
// new CustomPopupPlacementCallback(placePopup);
//myPopup.HorizontalOffset = control.ActualWidth - popupText.ActualWidth;
control.ToolTip = myPopup;
myPopup.IsOpen = true;
myPopup.StaysOpen = false;

- 8,314
- 9
- 55
- 59
-
Not very WPF friendly, more like a WinForms approach, but it does the trick. – Alexandru Dicu Nov 29 '19 at 01:24
ToolTip.Show()
is available for Windows Forms, not for WPF controls.
For WPF, if you simply want to display the ToolTip when the mouse enters the area of the control, you shouldn't need ToolTip.Show()
if you write ToolTip=""
in your XAML code (of the control for which you want the ToolTip) before the ToolTipOpening
event in that control's XAML.
For example, for a Button control:
<Button Name="exampleButton" Content="example" ToolTip="" ToolTipOpening="example_ToolTipOpening"/>
The ToolTip should then be displayed automatically every time the mouse enters the area of that control. (You can set which text to display in the ToolTipOpening event function. Or you can omit the ToolTipOpening
and set the text in the quotation marks of the ToolTip=""
)
Hope this helps.

- 51
- 9
If you already design tooltip in XAML, you can try that way:
((ToolTip)Calendar01.ToolTip).IsOpen = true;

- 663
- 5
- 11