Private Sub Plus_Btn_Click(sender As Object, e As EventArgs) Handles A_Plus_Btn.Click, C_Txb.Click
Dim Txb As TextBox
If x < MAX Then
x += 1
Else
x = 5
End If
For i As Integer = 1 To x
For j As Integer = 1 To x
Txb = New TextBox
Txb.Size = New Drawing.Size(100, 20)
Txb.Location = New Point(10 + 100 * i, 10 + 25 * j)
Txb.Name = "Txb" & i & "," & j
AddHandler Txb.TextChanged, AddressOf TextBox_TextChanged
boxes(i) = Txb
Me.Controls.Add(Txb)
Next
Next
End Sub
Private Sub TextBox_TextChanged(sender As Object, e As EventArgs)
Dim box As TextBox = DirectCast(sender, TextBox)
Me.Text = box.Name & ": " & box.Text
End Sub
Private Sub Minus_Btn_Click(sender As Object, e As EventArgs) Handles A_Minus_Btn.Click, C_Txb.Click
Dim Txb As TextBox
If x > MIN Then
x -= 1
Else
x = MIN
End If
For i As Integer = 1 To x
For j As Integer = 1 To x
Txb = New TextBox
Txb.Size = New Drawing.Size(100, 20)
Txb.Location = New Point(10 + 100 * i, 10 + 25 * j)
Txb.Name = "Txb" & i & "," & j
AddHandler Txb.TextChanged, AddressOf TextBox_TextChanged
boxes(i) = Txb
Me.Controls.Add(Txb)
Next
Next
End Sub
I want to make TextBox into array and increase/decrease with buttons.
ex) dim x=1 [+] [-]
x = 1:
[]
x = 2:
[][]
[][]
x = 3:
[][][]
[][][]
[][][]
...
But it's made with the code I wrote above, but it doesn't remove.
And it's not array system, it's hard to manage.