Dynamic controls in a Dynamic array

Typo

Newcomer
Joined
Oct 12, 2009
Messages
2
Hi All,

How would you add Dynamic controls to your form, from an array which size may vary depending on how many controls the user has selected and has been retrieved from a database?

I have some ideas but none work, so I was hoping somebody would show me how to do this?

Thank you,

Typo.
 
I have found the answer on our sister site Xtreme VBTalk:

For Each loop and call Controls.Add() to add each control to the form. Presuming you have declared some collection of controls named "selectedControls", it would look like this:
Code:
For Each ctl As Control In selectedControls
    Controls.Add(ctl)
Next


Thanks to AtmaWeapon
 
Back
Top