我想在光标位置下方显示工具提示,而不是在默认位置(它显示光标后面的工具提示)。我该如何确定其位置?
我什么都没做,但在表单中添加了一个工具提示,并编写了以下代码,以便在按钮悬停时显示:
toolTip1.Show("Text", button1);
答案 0 :(得分:3)
使用ToolTip.Show()
方法的重载:
public void Show(
string text,
IWin32Window window,
Point point
)
然后您的代码变为:
Point pos = new Point(Cursor.Position.X, Cursor.Position.Y - 1); //Change this to whatever you want
toolTip1.Show("Text", button1, pos);