Forum Discussion

madhukumar_tm's avatar
12 years ago

Adding component in userform from a script file



Requirement is to read a test cases list from excel sheet and add so many number of checkboxes in userform.

I am fine widh reading from excel and others.

Please suggest me on how to added components in userfom from script.

2 Replies

  • Hi Madhu,

     


    There's no way to create controls on user forms dynamically. However, we have a corresponding suggestion in our DB - I've added your vote to it.


     


    As for now, I can suggest that you use another approach: add, say, a list box to the form manually. When executing the script, you can populate the control via the Items property. Also, you can add an additional column and set its value to True or False for each item. Read the "TcxListBox Object" article for details.


     

  • As compromising solution I can suggest to create a form with "repository" with excessive number of all possible elements which may require (to cover maximum demand). All elements which not needed for specific situation can be disabled and hidden or moved out beyond of visible part of the form. Other controls can be resized/arranged on form using script depending of set of [Excel] parameters.