Search code examples
c#wpftooltip

user control tool tip not working in transparent sections


I have a user control with a label and an icon. I have managed to get the tool tip to show when I hover over the label or icon. However it does not show when i hover over transparent parts of the user control. Is there a way to fix this.

I have placed the tool tip in the grid, stack panel, controls them self's and also the user control tags but still the tool tip does not treat the user control as the whole area to show the tool tip.


Solution

  • The default value of the Background property of a Panel is null, which means it does not get any input events.

    From the Remarks section of the Panel.Background property page on MSDN:

    Panel elements do not receive mouse or stylus events if a Background is not defined. If you need to handle mouse or stylus events but do not want a background for your Panel, use Transparent.