winform textbox tooltip
时间: 2023-07-21 09:15:20 浏览: 340
要在 WinForm 的 TextBox 控件中添加工具提示,可以使用 ToolTip 控件。首先,将 ToolTip 控件拖放到窗体上,然后在 WinForm 的 TextBox 控件的 Properties 窗口中找到 ToolTip 属性,并将其设置为 ToolTip 控件的实例。接下来,可以在 ToolTip 控件的 Properties 窗口中设置提示文本。
另外,也可以在代码中设置工具提示文本。例如,以下代码将在 TextBox 控件上显示一个工具提示:
```
ToolTip toolTip1 = new ToolTip();
toolTip1.SetToolTip(this.textBox1, "这是一个工具提示");
```
注意,在代码中使用工具提示时,需要确保 ToolTip 控件已经被实例化,并且在窗体上可见。
阅读全文
相关推荐


















