LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 7.1 MS Treeview 6.0 Save Problem

Hello,

    I am attempting to use the MS Treeview 6.0 ActiveX control in Labview 7.1. I'm trying to do something as simple as creat a parent ("Test") and a child ("Test2"). The problem I am encountering is that the child does not appear when the VI is run, only the parent does. If you hit Save (Ctrl-S) while the VI is running the child will then appear. I do not understand this behaviour. Thanks for any help, the VI is posted in this thread.
0 Kudos
Message 1 of 5
(3,118 Views)
Hi,


The node is created just fine. It's just not automatically shown, because it's parent node is closed. If you'd double click on it, it would open, and the child node would show.


This is exactly how it is in e.g. explorer. All children are hidden until the parent node is opened. To check this simply put a long wait in the vi (e.g. 10000 ms), and double click the parent node. The child will show.


You can also wire a property node to the parent reference (coming out of "Add"), and set it's property "Expanded" to true.


Please note you have to close all references, even if you are not done with the tree. You should close the two references coming out of "Add", and the reference "Nodes". If not, you'll get a memory leak.


Regards,


Wiebe.




"Kenneth.Miller" <x@no.email> wrote in message news:1147725608012-365417@exchange.ni.com...
Hello,&nbsp;&nbsp;&nbsp; I am attempting to use the MS Treeview 6.0 ActiveX control in Labview 7.1. I'm trying to do something as simple as creat a parent ("Test") and a child ("Test2"). The problem I am encountering is that the child does not appear when the VI is run, only the parent does. If you hit Save (Ctrl-S) while the VI is running the child will then appear. I do not understand this behaviour. Thanks for any help, the VI is posted in this thread.



Test23.vi:
http://forums.ni.com/attachments/ni/170/184966/1/Test23.vi
0 Kudos
Message 2 of 5
(3,109 Views)
Thanks.

    I've got that done and now I have the tree automatically populating a given directory with the checkboxes. One problem I now run into is heirarchal selection. I'd like to be able to check a parent and have all of it's children etc be checked. Is this possible with the MS TreeView 6.0? Also how would I go about retrieving which boxes I have checked?

Regards,
Ken
0 Kudos
Message 3 of 5
(3,102 Views)
Ken,


You'll have to travers the hierarchy yourself. So you need to get a parent children, and for each child get it's childeren, etc. You'll have to use some kind of recursion for this.


Retreiving the checked boxes could be done the same way. you might also consider using events. Perhaps you can get a callback when an item is tagged. In the callback you can recurse all it's childeren and check/uncheck them, and update your bookkeeping in a buffer. If you're building a large application, the event option will be much cleaner.


As an alternative, you might keep a reference to every child, with it's key in a buffer. Then you can simply search for a key, and use it's reference to check if it is checked. This way you don't need to travers the entire tree each time. You might even keep a list of all (grand)childeren with each item in this buffer, so you can check/uncheck them without traversing.


Any reason why you use the MS tree and not the LV tree?


Regards,


Wiebe.


"Kenneth.Miller" <x@no.email> wrote in message news:1147810208593-366068@exchange.ni.com...
Thanks. &nbsp;&nbsp;&nbsp; I've got that done and now I have the tree automatically populating a given directory with the checkboxes. One problem I now run into is heirarchal selection. I'd like to be able to check a parent and have all of it's children etc be checked. Is this possible with the MS TreeView 6.0? Also how would I go about retrieving which boxes I have checked?Regards,Ken
0 Kudos
Message 4 of 5
(3,096 Views)
We are using the MS Treeview because we want to have the checkbox ability.

Regards,
Ken
0 Kudos
Message 5 of 5
(3,093 Views)