2

I want to assign a tooltip to a System.Windows.Shape.Path.

While the tooltip pops up when I touch the outline of the path I get no tooltip when I am inside the filled part of the path.

Can I change this behavior in some way? My only idea was to add the path to an additional control like a canvas and assign the tooltip to the canvas. But that seems to be a lot of work.

Is there any other way?

EDIT: The path is and should be filled. The tooltip should popup on the path outline and on the filled area inside.

TalkingCode
  • 13,407
  • 27
  • 102
  • 147
  • The sample I gave will work for a path using the fill property. Can you expand upon the shape of the path and what is currently filling it? – Adrian Jun 01 '11 at 22:08

2 Answers2

2

If you have not set the Fill property, the behavior you have is expected. Consider setting the Fill property to Transparent if you simply want an "outline" Path.

<Path Fill="Transparent" 
      ToolTip="My Tooltip" 
      Data="..." Stroke="..." StrokeThickness="..."  />
Adrian
  • 1,338
  • 8
  • 17
1

If you are creating the path dynamically, you can set like this:

Path p = new Path();
........
.......
p.Fill = new SolidColorBrush(Colors.Red);
p.SetValue(ToolTipService.ToolTipProperty, "Tooltip is here");
Chitta
  • 185
  • 2
  • 15