LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

select visible column in tree control

Hi!

 

I have a tree control with multiply columns. how can I set the selected column visible?

 

i.e., I want to see only the 2. 4. 5. columns, more must be hidden. is possible?

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 1 of 3
(3,312 Views)

Durnek:

 

CVI 9.0 has a function that lets you control column attributes, including whether or not the column is visible.

 

Here's the protoype:

 

int SetTreeColumnAttribute (int Panel_Handle, int Control_ID, int Column_Index, int Column_Attribute, ...);

 

Note that Column_Index is zero-based, statring at the left-most column.

 

// set the second column from the left (index = 1) invisible (= 0).

 

SetTreeColumnAttribute (panelHandle, PANEL_TREE, 1, ATTR_COLUMN_VISIBLE, 0);


// Set the left-most column (index = 0) visible (= 1)

 

SetTreeColumnAttribute (panelHandle, PANEL_TREE, 0, ATTR_COLUMN_VISIBLE, 1);

 

// panelHandle and PANEL_TREE must match the names in your own program

 

In the function panel for SetTreeColumnAttribute(), pull down the list labeled Column Attribute to see the list of other attributes you can set programmatically.

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

Update to my earlier post: apparently you can't set ATTR_COLUMN_VISIBLE for column index 0 (left-most column).  Trying to set it either visible or invisible generates a non-fatal runtime error "The index passed is out of range".  I don't see this identified in the function help (either the on-line help or the function panel help).

 

The help states that you can pass VAL_ALL_OBJECTS if you want to set the attribute for all columns in the tree, but that doesn't make the left-most column invisible either.

 

Using CVI version 9.0.1.

0 Kudos
Message 3 of 3
(3,267 Views)