How to find the way for the disappearance of the focus rectangle if the focus is lost in the treeViewAdv

1 Oct 20181 minute to read

This can be done by setting e.Active to false in BeforeNodePaint Event Handler.

  • c#
  • // Set the TreeViewAdv's OwnerDrawNodes property to true.
    
    
    
    this.treeViewAdv1.OwnerDrawNodes = true;
    
    
    
    //Handle the TreeViewAdv's BeforeNodePaint event as shown below :
    
    
    
    private void treeViewAdv1_BeforeNodePaint(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvPaintEventArgs e)
    
    {
    
    e.Active = false;
    
    }
  • vbnet
  • 'Declare the new node object. 
    
    Private NewNode As Syncfusion.Windows.Forms.Tools.TreeNodeAdv = New Syncfusion.Windows.Forms.Tools.TreeNodeAdv("Inserted Node") 
    
    Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
    
        Dim NewNode As TreeNodeAdv = New TreeNodeAdv() 
    
    
    
        ' Use Insert method to add nodes at particular index.
    
        Me.treeViewAdv1.Nodes.Insert(2, NewNode) 
    
    End Sub