Another Tree View problem arghh 
Author Message
 Another Tree View problem arghh

Ok so I can now control the treeview ffrom a BAS file but this now does not
work..

Private Sub News_View_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles News_View.Click

Select Case News_View.SelectedNode.Tag

Case Is = ""

Case Else

StatusBar.Text = News_View.SelectedNode.Tag

End Select

End Sub

any ideas..???



Sun, 27 Feb 2005 03:07:27 GMT  
 Another Tree View problem arghh

Quote:
> Ok so I can now control the treeview ffrom a BAS file but this
> now does not work..

You should tell us what does not work.

Armin

Quote:
> Private Sub News_View_Click(ByVal sender As System.Object, ByVal
> e As System.EventArgs) Handles News_View.Click

> Select Case News_View.SelectedNode.Tag

> Case Is = ""

> Case Else

> StatusBar.Text = News_View.SelectedNode.Tag

> End Select

> End Sub

> any ideas..???



Sun, 27 Feb 2005 05:43:43 GMT  
 Another Tree View problem arghh
This.. DOES NOT WORK

Private Sub News_View_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles News_View.Click

Select Case News_View.SelectedNode.Tag  <-- Errors right here.. something
about null object blah blah.. bunsh of crap..  I dont understand a{*filter*} of
it.

Case Is = ""

Case Else

StatusBar.Text = News_View.SelectedNode.Tag

End Select

End Sub



Sun, 27 Feb 2005 09:35:07 GMT  
 Another Tree View problem arghh

Quote:
> This.. DOES NOT WORK

> Private Sub News_View_Click(ByVal sender As System.Object, ByVal
> e As System.EventArgs) Handles News_View.Click

> Select Case News_View.SelectedNode.Tag  <-- Errors right here..
> something about null object blah blah.. bunsh of crap..  I dont
> understand a{*filter*} of it.

But you could quote it. Probably you get a "NullReferenceException", don't
you?

Looking at this piece of code, either news_view is Nothing or
News_View.SelectedNode is Nothing. News_View is probably not nothing because
the procedure is an event handler for news_view (unless the procedure
handles events of other objects too, but I assume it is not the case). What
remains is News_View.SelectNode. It is Nothing whenever no node is selected
in the Treeview. You should check if that's the case:

If Not News_View.SelectedNode Is Nothing then
    Select View.SelectedNode.Tag
        ...
    End Select
Else
    ...
End If

The Else block is optional, of course.

Armin



Sun, 27 Feb 2005 17:34:19 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. tree view and list view..

2. Tree View Control as file view

3. Tree View / List View

4. List View to Tree View

5. Tree View & List View Icons

6. Tree View Control Problem

7. Problem customizing VB .Net tree view context menu

8. how to storing tree view in database and avoid concurrency problem

9. Tree view problems

10. Problem with Tree View OCX in VB 5.0

11. Tree view problems

12. how to storing tree view in database and avoid concurrency problem

 

 
Powered by phpBB® Forum Software