Showing results for 
Search instead for 
Did you mean: 

Dynamically Create Control Objects in a SUD Dialog Box

Go to solution

I'm wondering if there is a way in code to dynamically create buttons, text objects, etc in a SUD dialog box.  In my case, I have an array set in code with a number of items, and I'd like to create text objects named from those items in the array.  So instead of creating them by hand, I want the code to do it for me.

0 Kudos
Message 1 of 2
Accepted by sbazzle

It is not possible to create controls dynamically via script in a sud dialog. As each control can be shown and hidden, you could create controls in the dialog that are initially hidden. Later you can make them visible and move them to another position if necessary.

Another option is to use the XTable. There you could create a column for each control type (text, edit box, button). If several texts or edit boxes are needed, increase the number of rows. Cells that should be empty and not editable can be hidden or disabled using Visible = 0 or Enable = 0 (in EventValGet). However, this variant leads to an unusual dialog design ;-).

0 Kudos
Message 2 of 2