How to access dynimically added controls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sdanda
    New Member
    • Oct 2007
    • 36

    How to access dynimically added controls

    Hi I added some controls(textbo xes) dynimically to a vb.net windows application form in the form load event.In My form I added a button statically.Now I would like to access my controls like the text entered in the dynimically added textboxes in button click event.How to do this?
  • nev
    Contributor
    • Oct 2007
    • 251

    #2
    Originally posted by sdanda
    Hi I added some controls(textbo xes) dynimically to a vb.net windows application form in the form load event.In My form I added a button statically.Now I would like to access my controls like the text entered in the dynimically added textboxes in button click event.How to do this?
    for each ctl as control in form.controls
    if typeof ctl = textbox then
    'place code here
    end if
    next

    Comment

    Working...