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
(2,365 Views)
Solution
Accepted by topic author 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
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 4
(2,352 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

0 Kudos
Message 3 of 4
(2,331 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.

 

0 Kudos
Message 4 of 4
(1,985 Views)