开发者

c# tooltip help

I am using a tooltip to display information when the user mouse_hovers on treeview nodes. That side of it works perfectly as expected. However I am having difficulty with the tooltip being visible when the mouse cursor leaves the treeview control. I have tried messing around and setting the properties such as AutoPopDelay, etc but I cannot seem to get this right. No matter what I do, when I move the cursor to开发者_开发问答 the next control, the tooltip is obstructing the users view.

Any advice please?

Thanks.


I am guessing you are using the treeview's NodeMouseHover event to render the tooltip, right? In that case you can use the 'MouseLeave' event to hide the tooltip once you leave the treeview.

void treeView1_MouseLeave(object sender, EventArgs e)
{
   myToolTip.Hide();
}


I’m probably missing something important/obvious here, but why don’t you use the tooltip property of the treeview nodes?

To activate tooltips on the treeview:

treeView1.ShowNodeToolTips = true;

To set the tooltip of a node:

treeView1.Nodes[0].ToolTipText = "Blah";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜