Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Update the size (height) of a Listbox (UI builder)

To all

 

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?

 

Thanks

Regards

 

If myList.Count < 10 Then
	myLboxInGUI.Height = myList.Count
Else
	myLboxInGUI.Height = 10
End if	

 

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
4 REPLIES
Solution
Solution
Accepted by topic author selex_ct
‎10-23-2015 07:49 AM

Re: Update the size (height) of a Listbox (UI builder)

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.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Update the size (height) of a Listbox (UI builder)

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.

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Update the size (height) of a Listbox (UI builder)

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:

 

https://docs.plm.automation.siemens.com/tdoc/nx/10/nx_api/#uid:index_blockstyler:id1153911:id1154006...

 

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.

Re: Update the size (height) of a Listbox (UI builder)

If you want to update the size during execution, you'll probably have to file an ER.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled