Boolean cnversion of treeview properties 
Author Message
 Boolean cnversion of treeview properties

Unperplex me.

For treeview control this works:
        If myNode.Children = False Then

And this works
        If myNode.Children Then

But this does not work
        If Not myNode.Children Then  ' Always true

Mon, 25 Aug 2003 19:51:43 GMT  
 Boolean cnversion of treeview properties

The Children proeprty returns an Integer, not a Boolean.

>But this does not work
>        If Not myNode.Children Then  ' Always true

Not is a bitewise operator. Therefore, (Not myNode.Children) will
return a nonzero value for all values of myNode.Children <> &HFFFF.

Do it like this

If Not CBool(myNode.Children) Then


If myNode.Children = 0 Then




CodeHound - The Software Developer's Search Engine

Mon, 25 Aug 2003 22:36:13 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Webpage OCX boolean properties show unsupported variant type when put in VB6

2. Treeview control's property

3. What Happened to the Treeview.Nodes.Count Property?

4. Help: TreeView Control & Key Property

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

6. Treeview control tag property

7. Treeview enabled property

8. Help with TreeViews, ImageList, and the BackColor property

9. TreeView Node .Enabled property

10. Treeview key property in the nodes collection

11. Ghosted property for Treeview

12. Properties of underlying treeview for component


Powered by phpBB® Forum Software