ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Top Left Empty Tree Control

Solved!
Go to solution

There must be an easy way to do this, but I cannot find the answer.

 

Assume I have a Tree Control that needs a horizontal scroll bar, ie, it is not expanded such that you can see all columns. See Below:

Snap27.png

When the program start ups, the tree is EMPTY and the top left cell is not 0,0. I want to set the top left cell to 0,0, but I can not as the Top Left Visible Cell Property returns an error if the tree is empty. (This is expected behavior according to help)

 

  1. Am I missing something else? Or ...
  2. Do I need to make a "dummy" value for the tree to set the Top Left Cell? Or ...
  3. Is there a property node I am missing for the scroll bar value, that is, can I change it directly?

Thanks

mcduff

0 Kudos
Message 1 of 4
(3,505 Views)
Solution
Accepted by mcduff

Use a Key Focus True, Edit Position (0,0), Key Focus False all in the same property node.  It seems like a hack but it does work.

aputman
Message 2 of 4
(3,492 Views)

@aputman wrote:

Use a Key Focus True, Edit Position (0,0), Key Focus False all in the same property node.  It seems like a hack but it does work.


Thanks!!

It is a much better hack than mine! I inserted an empty item into the tree, set the Left Corner Position, then erased the tree.

 

Cheers,

mcduff

Message 3 of 4
(3,471 Views)

I can confirm that in normal running vi the KeyFocus trick works.

 

Seems however there's a caveat with it.

If you're running your tree control instance in a vi that runs in a subpanel, it fails to do anything.

There is no error either, it just doesn't do anything.

 

Add item - set visible item - remove item cycle seems like the only way here.

 

Message 4 of 4
(3,125 Views)