This is my code to create textboxs with button.
Now I need a button which to delete all the text box.
What is the way of doing it ??
AND
can I write the code below as a class and I just call the class in the button only??
For Me.count = count To 5
Dim label1 = New Label
With label1
.Name = "lblNo" & count
.Size = New Size(32, 26)
.Location = New Point(x, y)
'.Font = txtNum1.Font
.TextAlign = HorizontalAlignment.Center
.Text = count & "."
.TabStop = False
Controls.Add(label1)
End With
x += 53
Dim myTextBox2 = New TextBox
With myTextBox2
.Name = "txtNum" & count
.Size = New Size(50, 26)
.Location = New Point(x, y)
' .Font = txtNum1.Font
.TextAlign = HorizontalAlignment.Center
.MaxLength = 4
Controls.Add(myTextBox2)
End With
x += 75
Dim myTextBox3 = New TextBox
With myTextBox3
.Name = "txtBig" & count
.Size = New Size(50, 26)
.Location = New Point(x, y)
' .Font = txtNum1.Font
.TextAlign = HorizontalAlignment.Center
.MaxLength = 6
Controls.Add(myTextBox3)
End With
x += 70
Dim myTextBox4 = New TextBox
With myTextBox4
.Name = "txtSmall" & count
.Size = New Size(50, 26)
.Location = New Point(x, y)
' .Font = txtNum1.Font
.TextAlign = HorizontalAlignment.Center
.MaxLength = 6
Controls.Add(myTextBox4)
End With
x = 12
y += 25
Next
If count >= 11 Then
MessageBox.Show("Maximum rows are 10", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If