|
-
Jan 30th, 2003, 01:05 PM
#1
Thread Starter
Member
VB.NET Doesnt like this code
Ok here it is:
Private Sub TreeView1_AfterSelect (blah blah blah)As Blah
Select Case TreeView1.Nodes.IndexOf(e.Node)
Case 0
Label1.Hide()
Case Is >0
Label1.Show
End Select
End Sub
It always hides! It never shows! It likes the code, but it doesnt use it right. What am I doing wrong, and if this isnt the right Sub then what action should i do it on. I am new to this TreeView Thing.
Josh
Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com
-
Jan 30th, 2003, 02:40 PM
#2
Registered User
Try this....
Code:
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Select Case e.Node.Index
Case 0
Label1.Hide()
Case Is > 0
Label1.Show()
End Select
End Sub
-
Jan 30th, 2003, 02:42 PM
#3
Sleep mode
Originally posted by Athley
Try this....
Code:
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Select Case e.Node.Index
Case 0
Label1.Hide()
Case Is > 0
Label1.Show()
End Select
End Sub
won't work either ..
-
Jan 30th, 2003, 02:43 PM
#4
Sleep mode
VB Code:
Select Case TreeView1.Nodes.IndexOf(e.Node)
Case 0
Label1.Hide()
Case Is < 0 'changed from > to <
Label1.Show()
End Select
works for me
-
Jan 30th, 2003, 02:45 PM
#5
Registered User
quote:
--------------------------------------------------------------------------------
Originally posted by Athley
Try this....
code:--------------------------------------------------------------------------------Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Select Case e.Node.Index
Case 0
Label1.Hide()
Case Is > 0
Label1.Show()
End Select
End Sub
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
won't work either ..
Kinda intresting that it worked for me!?!
-
Jan 30th, 2003, 02:50 PM
#6
Sleep mode
Originally posted by Athley
Kinda intresting that it worked for me!?!
when you descend the treeview index becomes upperindex + 1
vice versa when you goint up gets -1
-
Jan 30th, 2003, 02:55 PM
#7
Registered User
I'm not sure I understand what you mean, but I tried adding ten nodes to my treeview and the label is hidden when I select the topmost node and shows on all others....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|