mje Posted May 16, 2011 Report Share Posted May 16, 2011 I have a tree control in one of my user interfaces which I just removed a column from. The problem now is that I can't seem to convince LabVIEW that I actually don't want that column. My tree always has an empty column at the right, and the scrollbar always sizes for this column: Surely there's some way of convincing the IDE I actually don't want that column? Short of replacing the control and reconfiguring a new one (hoping I don't break anything in the process), I can't think of any other way... Quote Link to comment
PaulL Posted May 17, 2011 Report Share Posted May 17, 2011 I'm sure this isn't what you are asking, since that would be too simple, but maybe it will help someone: In the Tree Properties dialog (I'm looking at the System version) on the Appearance tab there are ring controls to set the number of Rows and Columns, as well as set the properties of the scroll bars. Presumably the control is no longer in a state where you can do this? Quote Link to comment
mje Posted May 17, 2011 Author Report Share Posted May 17, 2011 I can indeed do as much, but that only appears to modify the number of visible rows by resizing the tree. The scrollbars still size to the contents of the "old" columns, so the user will always be able to scroll out to the blank column. The best I can do is size the empty column to a few pixels wide. Unfortunately it's looking like I have to delete and recreate the control. Unfortunately this might introduce defects if I forget to set the new control's properties exactly the same as the original, so I've been holding off on doing that. Yet another "I hate LabVIEW UI elements" vote... Quote Link to comment
SometimesRight Posted October 7, 2015 Report Share Posted October 7, 2015 I doubt that recreating the control helped mje but perhaps he will let us know. In my experience, using the well-know scientific trial & error methodology, the number of columns in a tree is to a large extent dependent on how many are visible in the GUI. If you delete a column you need to resize the remaining columns to fit in the control or reduce the control width, making sure that your last wanted column boundary is just hidden beneath the control border. Then adjust the number of columns property. Be warned: if you later drag the right-hand border of the control to enlarge the real estate you will magically get that pesky extra column again - the number of columns property will increase by however many columns you expose! It seems to me that a better behaviour would be to just make the extra space to the right the number of columns dead, and never alter the number of columns until the user explicitly sets it. Quote Link to comment
hooovahh Posted October 7, 2015 Report Share Posted October 7, 2015 A lot has changed in 4 years but this still seems to be the normal behavior of a tree control. At some point the multicolumn listbox was improved to actually realize when a column was deleted by right clicking, and adjust horizontal scrollbar size accordingly. But there isn't a similar option for a tree control. Replacing the control does indeed convince LabVIEW the number of columns are different, and that is how I've always handled this situation. One step that might help make this process easier is you can replace a control in LabVIEW, with one in your clipboard, and have all the references, and events on that control go to the new one. I tested this and it does behave as you'd expect in terms of the number of columns. I created a tree with a string in columns 3 and 4, then deleted the string in column 4 and saw that the size according to the visible scrollbar still shows column 4 in the size. I then created a new tree, copied it to the clipboard, selected the old tree and pasted, which replaced the old one with the new one. Changing the column width to 1 pixel can work as well. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.