Question : Tree Node Font or graphics change On Mouse HOver

I want To change the font or graphical display of nodes in a treeview on mouse hover.It means that whenevr user hovers the mouse over each node the node has a different effect and then changes back to its previous font when the mouse shifts to another node and so on.
Thanx in advance.

Answer : Tree Node Font or graphics change On Mouse HOver

If its a WinForms app then you need to keep a reference to the previously hovered over node, seeing as there is not event that allows for a node losing hover:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
    Private Sub TreeView1_NodeMouseHover(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeNodeMouseHoverEventArgs) Handles TreeView1.NodeMouseHover

        '// Check if there is a previous node. Set its font normal if there is.
        If Not previousNode Is Nothing AndAlso Not previousNode.Equals(e.Node) Then
            previousNode.NodeFont = New Font(TreeView1.Font, FontStyle.Regular)
        End If

        '// Set a bold font on the current hover node
        e.Node.NodeFont = New Font(TreeView1.Font, FontStyle.Bold)
        previousNode = e.Node

    End Sub

    Dim previousNode As TreeNode = Nothing
Random Solutions  
 
programming4us programming4us