I am making some "cosmetic" changes/adjustments to a code containing a UI Builder GUI with Listboxes. I'd like to change the "height" of a list box depending on the count of the list going into that listbox. Does anyoone know in which functions one should put the following lines?
If myList.Count < 10 Then myLboxInGUI.Height = myList.Count Else myLboxInGUI.Height = 10 End if
Solved! Go to Solution.
Some things, including setting the height of a ListBox, can only be done when designing the dialog or in the initialize() method.
So you need to set the height of your ListBoxes in your initialize() method.
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX184.108.40.206 MP11 64bit Testing: NX220.127.116.11
Thanks Graham for confirming rhis. Bit of shame as I would have liked to update the "height" every time a list is created and dispalyed.
For future reference, this could also be confirmed via the online documentation. The online documentation for each block contains a table with an "Access" column that details where each property can be modified or read:
The List Box height property is listed as CIG, which means that it can be set at Creation (in the Block UI Styler) or in the Initialize callback. It does not contain an S in the access column, which would mean that it could be Set in any callback.
If you want to update the size during execution, you'll probably have to file an ER.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled