BP Forums
TreeView: Selected items - Printable Version

+- BP Forums (https://bpforums.info)
+-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55)
+--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56)
+---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8)
+----- Forum: Programming Help (https://bpforums.info/forumdisplay.php?fid=9)
+----- Thread: TreeView: Selected items (/showthread.php?tid=659)



TreeView: Selected items - brco900033 - 09-26-2012

Hi all
I have a question about the TreeView. How can I declare if nothing is selected in the TreeView.

Thanks in advance


Re: TreeView: Selected items - brandonio21 - 09-26-2012

Do you want to clear the current selection? Or check to see if the user is currently selecting something?


Re: TreeView: Selected items - brco900033 - 09-27-2012

The second one. I want to know if the user selected something.


Re: TreeView: Selected items - brandonio21 - 09-27-2012

If you are using .NET 3.0 or above, the following code will work to see if the user is selecting something.

[code2=vbnet]If Not (TreeView1.SelectedItem Is Nothing) Then
MsgBox("The User is not selecting anything!")
End If[/code2]