TreeView Control - Checked property of Node not working 
Author Message
 TreeView Control - Checked property of Node not working

Hi ,

    I am using the treeview control in the system that I am writing.

I want to programatically check the checkbox beside the node by setting the
checked property
of the node to true. However, the node is still not checked when it is run.

Do anyone know this problems?

Thanks a lot
Ivan



Sat, 22 May 2004 17:55:43 GMT  
 TreeView Control - Checked property of Node not working
Try...
'===============
Private Sub Form_Load()
   Dim i As Integer
   With TreeView1
      .Checkboxes = True
      For i = 1 To 10
         .Nodes.Add , , , "Item " & i
      Next
      Set .SelectedItem = .Nodes(2)
      .SelectedItem.Checked = True '<---------- Works
   End With
End Sub
'===============

--
Ken Halter
MS-MVP-VB
http://www.vbsight.com
Please respond only to the newsgroups so all can benefit.
Besides.. I check my email only once a week :-)


Quote:
> Hi ,

>     I am using the treeview control in the system that I am writing.

> I want to programatically check the checkbox beside the node by setting
the
> checked property
> of the node to true. However, the node is still not checked when it is
run.

> Do anyone know this problems?

> Thanks a lot
> Ivan



Sat, 22 May 2004 23:08:12 GMT  
 TreeView Control - Checked property of Node not working
I tried your version Ken Halter, and it may work fine when you are not
using any imagelists. But the problem occurs when you add a imagelist
to the treeview.
Then it will still not work unless you add the node, check it, remove
it and add it again. Well this worked for me thusfar, looking for
better way to do this though. There must be some way of refreshing
them but I haven't found one yet. If anybody does know, please respond
to mail adress...
Quote:

> Try...
> '===============
> Private Sub Form_Load()
>    Dim i As Integer
>    With TreeView1
>       .Checkboxes = True
>       For i = 1 To 10
>          .Nodes.Add , , , "Item " & i
>       Next
>       Set .SelectedItem = .Nodes(2)
>       .SelectedItem.Checked = True '<---------- Works
>    End With
> End Sub
> '===============

> --
> Ken Halter
> MS-MVP-VB
> http://www.vbsight.com
> Please respond only to the newsgroups so all can benefit.
> Besides.. I check my email only once a week :-)



> > Hi ,

> >     I am using the treeview control in the system that I am writing.

> > I want to programatically check the checkbox beside the node by setting
>  the
> > checked property
> > of the node to true. However, the node is still not checked when it is
>  run.

> > Do anyone know this problems?

> > Thanks a lot
> > Ivan



Fri, 04 Jun 2004 06:17:46 GMT  
 TreeView Control - Checked property of Node not working
That code works perfectly on my machine. Maybe it's that acid dust causing
hallucinations. <grin>


Quote:
> I tried your version Ken Halter, and it may work fine when you are not
> using any imagelists. But the problem occurs when you add a imagelist
> to the treeview.
> Then it will still not work unless you add the node, check it, remove
> it and add it again. Well this worked for me thusfar, looking for
> better way to do this though. There must be some way of refreshing
> them but I haven't found one yet. If anybody does know, please respond
> to mail adress...




Quote:
> > Try...
> > '===============
> > Private Sub Form_Load()
> >    Dim i As Integer
> >    With TreeView1
> >       .Checkboxes = True
> >       For i = 1 To 10
> >          .Nodes.Add , , , "Item " & i
> >       Next
> >       Set .SelectedItem = .Nodes(2)
> >       .SelectedItem.Checked = True '<---------- Works
> >    End With
> > End Sub
> > '===============

> > --
> > Ken Halter
> > MS-MVP-VB
> > http://www.vbsight.com
> > Please respond only to the newsgroups so all can benefit.
> > Besides.. I check my email only once a week :-)



> > > Hi ,

> > >     I am using the treeview control in the system that I am writing.

> > > I want to programatically check the checkbox beside the node by
setting
> >  the
> > > checked property
> > > of the node to true. However, the node is still not checked when it is
> >  run.

> > > Do anyone know this problems?

> > > Thanks a lot
> > > Ivan



Mon, 07 Jun 2004 07:43:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Treeview.node().checked property

2. Treeview nodes do not have forecolor property.

3. TreeView Node tooltips not working - HELP

4. Preventing Nodes from being checked in the Treeview Control

5. VB6 TreeView Control Node Check

6. treeview node count not incrementing when adding new nodes

7. Problem with TreeView control Nodes and assigning objects to Tag property

8. TreeView Control - Nodes Visible Property

9. HOWTO: Prevent flicker in TreeView control when changing the .Image property of a Node object

10. Treeview control, Node Key property

11. HOWTO: Prevent flicker in TreeView control when changing the .Image property of a Node object

12. HOWTO: Prevent flicker in TreeView control when changing the .Image property of a Node object

 

 
Powered by phpBB® Forum Software