How to Programmatically show a WPF/C# Windows.Control.ToolTip?

后端 未结 7 2030
温柔的废话
温柔的废话 2020-12-25 12:01

There doesn\'t seem to be a .Show() kind of method for the Windows.Control.ToolTip, incl in ToolTipService.

7条回答
  •  既然无缘
    2020-12-25 12:53

    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;    
    

提交回复
热议问题