How do I force showing a tooltip in WPF

Posted by user316030 on Stack Overflow See other posts from Stack Overflow or by user316030
Published on 2010-04-17T03:23:26Z Indexed on 2010/04/17 3:33 UTC
Read the original article Hit count: 1105

Filed under:
|

Hello, I'd like to show a tooltip when I move the mouse. Here is my code:

 private void Grid_MouseMove(object sender, MouseEventArgs e)
        {
            Grid grid = (Grid) sender;
            if (e.GetPosition(grid).X < 100)
                grid.ToolTip = e.GetPosition(grid).X.ToString();
            else
                grid.ToolTip = null;
        }

However, the tooltip disappears after I click on the grid.

Is there a way to force showing the tooltip?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about tooltip