i have a class:
VB Code:
  1. Public Class FilesFoldersList
  2.     Inherits Windows.Forms.TreeView
  3.     Public Quit As Boolean = False
  4.     Public Function FindNode(ByVal TNC As TreeNodeCollection, ByVal Text As String) As Windows.Forms.TreeNode
  5.         Dim TN As TreeNode
  6.         For Each TN In TNC
  7.             If Quit = True Then Exit Function
  8.             Debug.WriteLine(TN.Text)
  9.             If TN.Text = Text Then
  10.                 FindNode = TN
  11.                 Quit = True
  12.                 Exit Function
  13.             End If
  14.             FindNode(TN.Nodes, Text)
  15.         Next
  16.  
  17.     End Function
  18. End Class

which i use to find a certain node in a treeview, and this is how i use it:

VB Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim TN As TreeNode
  3.         TN = FFList.FindNode(FFList.Nodes, "C:\timem")
  4.         MsgBox(TN.Text)
  5.     End Sub

the FindNodes function works, but it won't return anything. I checked everything and it should work. it keeps saying that TN=Nothing. anyone see what is the problem?