creating runtime controls
I am trying to create a form that allows the user to enter the number of text box controls they want to generate and then have the form generate these controls triggered via the click event of the submit button.
It appears I could do this as 2 forms and create the 2nd form dynamically but I thought I could use the same form and simply add the new controls to the Controls() collection and then refresh the form rather than closing the old form and opening a new one.
Does anyone have any thoughts or ideas?
found my own answers again
Well, once again I posted something and somehow imemdiately answered my own question. As it turns out, this is quite easy. I just set some controls within the onclick even of a button and I did not need to call a refresh.
Dim myLabel As Label = New Label()
Dim myLabel2 As Label = New Label()
Me.Controls.Add(myLabel)
Me.Controls.Add(myLabel2)
myLabel.Text = "Dynamically added label control."
myLabel.Left = 100
myLabel.Top = 10
myLabel2.Text = "Dynamically added label control."
myLabel2.Left = 100
myLabel2.Top = 35