在TreeView的TreeNode节点上引用tooltip控件生成提示,出现不停的刷新闪烁。各位谁有好的方法?
private void treeView2_MouseMove(object sender, MouseEventArgs e)
{
// Get the node at the current mouse pointer location.
TreeNode theNode = this.treeView2.GetNodeAt(e.X, e.Y);
// Set a ToolTip only if the mouse pointer is actually paused on a node.
if ((theNode != null))
{
// Verify that the tag property is not "null".
//if (theNode.Tag != null)
//{
// Change the ToolTip only if the pointer moved to a new node.
//if (theNode.Tag.ToString() != toolTip1.GetToolTip(this.treeView2))
//{
theNode.ToolTipText = "";
this.toolTip1.SetToolTip(this.treeView2, theNode.Text.ToString());
//}
//}
//else
//{
//this.toolTip1.SetToolTip(this.treeView2, theNode.Text.ToString());
//}
}
else // Pointer is not over a node so clear the ToolTip.
{
this.toolTip1.SetToolTip(this.treeView2, "");
}
private void treeView2_MouseMove(object sender, MouseEventArgs e)
{
// Get the node at the current mouse pointer location.
TreeNode theNode = this.treeView2.GetNodeAt(e.X, e.Y);
// Set a ToolTip only if the mouse pointer is actually paused on a node.
if ((theNode != null))
{
// Verify that the tag property is not "null".
//if (theNode.Tag != null)
//{
// Change the ToolTip only if the pointer moved to a new node.
//if (theNode.Tag.ToString() != toolTip1.GetToolTip(this.treeView2))
//{
theNode.ToolTipText = "";
this.toolTip1.SetToolTip(this.treeView2, theNode.Text.ToString());
//}
//}
//else
//{
//this.toolTip1.SetToolTip(this.treeView2, theNode.Text.ToString());
//}
}
else // Pointer is not over a node so clear the ToolTip.
{
this.toolTip1.SetToolTip(this.treeView2, "");
}
解决方案 »
- 在c#如何将DataGridview中的内容打印出来
- 关于一个SQL查询
- Winform 有没有ViewState这个属性啊?高手的进来、嫖客的进来、大虾的进来、
- Datagridview的动态录入到数据库
- 做模拟登录126邮箱发邮件
- IEnumerable 接口与foreach
- 使用SplitContainer时,发现里面的控件没有随拖动滚动条而随之改变控件的大小,应该怎么做???
- 如何调试Installer安装程序类?
- 请问c#中Winform得控件TextBox怎么实现换行?一行一行得写进去??
- 用visual studio 2005自动生成的DataGridView怎么在操作数据时出现这样的错误阿?
- 从c++ .dll接收到的unsigned long IP地址如何在C#中转换成*.*.*.*?
- Interop和AxInterop的区别
{
toolTip1.SetToolTip(this.treeView1, e.Node.Text);
}
以前做过类似的,是延长显示 ToolTip 的时间
是把 显示 ToolTip的方法重新了,引用了Timer
你这个不断显示用这种方法也应该可以
NodeMouseHover事件好了一点
同意 1楼