set textBox in dinamic way

nit9

Newcomer
Joined
Oct 12, 2004
Messages
7
'hi
'this is my sub for :
Visual Basic:
Sub fillTextBox()
        Dim i As Integer
        Dim j As Integer
        For i = 0 To 2
            For j = 0 To 9
                Me.ArrayTextBox(i, j) = New System.Windows.Forms.TextBox()
                Me.ArrayTextBox(i,j).Cursor=System.Windows.Forms.Cursors.Hand
                Me.ArrayTextBox(0, 0).Size = New System.Drawing.Size(20, 20)
                Me.ArrayTextBox(i, j).Location = New System.Drawing.Point(i*40,j* 20)
                ArrayTextBox(i, j).Enabled = True
            Next
        Next
End Sub
'after i run my program and call to this sub - the textBox not show
'on my form - what should i do?, thanks
 
Last edited by a moderator:
Because it is not on your form.
You have to add it to your form. :)

Me.Controls.Add(ArrayTextBox(i, j))

Also, are these zeroes supposed to be i and j in the following line:
Me.ArrayTextBox(0, 0).Size = New System.Drawing.Size(20, 20)
?
 
Back
Top