工具提示定位C#

Laz*_*usG 1 .net c# tooltip

我有一个带有mousehover事件的图片框,用于显示基于服务状态的工具提示.这似乎是有效的,但它只是弹出鼠标的位置,有时在鼠标下方,在图片的中间,看起来不正确.我正在阅读http://msdn.microsoft.com/en-us/library/windows/desktop/aa511495.aspx#infotipsgl,它建议将工具提示移到一边.这将是伟大的,但我无法弄清楚如何移动它.

toolTip1上的工具提示为空白,并且我尝试过使用的mouseHover事件

toolTip.SetToolTip(this.pictureBox1, "Message text.");
Run Code Online (Sandbox Code Playgroud)

toolTip.Show("Message text.", pictureBox1);
Run Code Online (Sandbox Code Playgroud)

谢谢

ygs*_*oni 5

ToolTip tooltip = new ToolTip();
tooltip.Placement = PlacementMode.Right;
tooltip.PlacementRectangle = new Rect(50, 0, 0, 0);
tooltip.HorizontalOffset = 10;
tooltip.VerticalOffset = 20;
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅此处

  • 放置仅适用于 WPF,不适用于 Winforms (4认同)