Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click Dim txtB1 As New TextBox Dim i For i = 0 To 5 Me.Controls.Add(txtB1) With txtB1 .Name = "chkDemo" & i End With Next i End Sub
but it only creates one(well as i can see) and i cant tell whether the name is actually set as chkDemo(how to check?). I tried adding
.Location = 20,20 but got error something to do with integer. Once i got this down, my goal is to actually dynamically add multiple textboxes or even maybe a combobox at the same time.
thanks in advance