LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Does the tree_view control have the attribute of LabelEdit??

Hi, experts:
      
      I am in trouble of editting the  label of tree_view item  in a running program.
      Now,   I am doubt about that , tree_view control really has the attribute of LabelEdit?
      Please reply me a "SB" if it does not have, or give me a way! Thanks!!
                             
                                                                                                          yours,  qhb.
0 Kudos
Message 1 of 3
(2,869 Views)
Hi qhbo,
 
You can use the following function to change the label on a tree while your program is running:
 
SetTreeItemAttribute (
    panel, //Panel handle on which the tree is located
    PANEL_TREE, //ID of the tree on the panel
    index, //index of the item whose label on the tree you wish to change
    ATTR_LABEL_TEXT,  //Attribute you wish to change (the text label in this case)
    "Hello World" ); //The value of the new label of the tree item
   
0 Kudos
Message 2 of 3
(2,857 Views)

If you want to change the label programmatically, call SetTreeItemAttribute(panel, tree, ATTR_LABEL_TEXT, newLabel). If you want the user of your program to be able to change the label at runtime, they can just hit <F2>, which puts the currently active tree item in edit mode.

You can restrict this ability using the tree item attribute ATTR_NO_EDIT_LABEL.

If you want the user to be able to edit the value of tree cells in a multicolumn tree, check out http://forums.ni.com/ni/board/message?board.id=180&message.id=8629#M8629

- jared

0 Kudos
Message 3 of 3
(2,851 Views)