Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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:

For Each ctl As Control In selectedControls
   Controls.Add(ctl)
Next

 

 

Thanks to AtmaWeapon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...