I am trying to show a tooltip when the mouse hovers over a treeview node. But the tooltip is not displayed.
This is my code:
private void treeView1_MouseHover(object sender, EventArgs e) { toolTip1.RemoveAll(); TreeNode selNode = (TreeNode)treeView1.GetNodeAt(Cursor.Position); if (selNode != null) { if (selNode.Tag != null) { Product selProduct = selNode.Tag as Product; if (selProduct != null) { toolTip1.SetToolTip(treeView1, selProduct.ProductName + "\n" + selProduct.ProductCategory.ToString()); } } } }
What should I check?
c # winforms treeview mousehover
anonymous
source share