title: How to generate dynamic textbox in vb.net
body: <p>I'm new in vb.net and I have successfully generate textbox dynamically as below image <img src="https://i.stack.imgur.com/KylNI.jpg" alt="enter image description here"></p>
  
  <p>but my problem is, I want my output to be like this</p>
  
  <p><img src="https://i.stack.imgur.com/Z0sFk.jpg" alt="enter image description here"></p>
  
  <p>I have been use code below to generate those textbox. Could anybody fixed my code. Thanks</p>
  
  <pre><code>Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles   Button1.Click
  
      Dim table1 As Table
  
      table1 = GetRow(txtRow.Text)
      table1 = GetColumn(txtColumn.Text)
  
  End Sub
  
  Private Function GetRow(ByVal strRow As String)
  
      Dim txt1 As TextBox
      Dim i As Integer = 0
      While i &lt; "" &amp; txtRow.Text &amp; ""
  
          txt1 = New TextBox()
          txt1.ID = "myTextBox" &amp; i
          Panel1.Controls.Add(txt1)
          Dim lit As New Literal()
          Panel1.Controls.Add(lit)
          System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
  
      End While
  
  End Function
  
  Private Function GetColumn(ByVal strColomn As String)
  
      Dim txt1 As TextBox
      Dim i As Integer = 0
      While i &lt; "" &amp; txtColumn.Text &amp; ""
  
          txt1 = New TextBox()
          txt1.ID = "myTextBox" &amp; i
          Panel1.Controls.Add(txt1)
          Dim lit As New Literal()
          lit.Text = "&lt;br&gt;"
          Panel1.Controls.Add(lit)
          System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
  
      End While
     End Function
   End Class
  </code></pre>