Tôi đang cố gắng hiển thị chú giải công cụ khi di chuột lên nút treeview. Nhưng chú giải công cụ không hiển thị.Chú giải công cụ di chuột TreeNode không hiển thị
Đây là mã của tôi:
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());
}
}
}
}
tôi nên kiểm tra cái gì?
Chú giải công cụ được hiển thị tự động khi bạn bật chúng, như được giải thích trong câu trả lời tiếp theo. Không cần phải xử lý sự kiện 'MouseHover'. –