Hi,
In Form 3 I have one Text box and Button.
Question #1: If I enter 200 value in Form3 Texbox.1 And button1 click and then next I want to create 200 Textboxes in the form3. I already the code but it is not working. It is creating the text boxes but box to box distance is enlarging. How can I maintain same distance to each textbox.
Question #2: Whatever the input I am giving in Textbox.1 same number of lables should be created in form1. How can I do it.
Question #3: These 200 Textboxes / labels text or values to be populated into Excel sheet as headers.
Here is the code for Question #1:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim txtb As New TextBox
Dim i As Integer
i = TextBox1.Text
If i < 1 Or i > 257 Then
MsgBox("Please provide DB Headers Count less then 256", MsgBoxStyle.OkOnly = True, "DB Header Count")
End If
For Row = 1 To 1
For Col = 1 To i
If i < 257 = True Then
txtb = New TextBox
txtb.Size = New Drawing.Size(200, 20)
txtb.Location = New Point(10 + 100 * Row, 10 + 25 * Col)
txtb.Name = txtb.Name
boxes(Row, Col) = txtb
Me.Controls.Add(txtb)
Else
MsgBox("Please provide DB Headers Count less then 256", MsgBoxStyle.OkOnly = True, "DB Header Count")
If vbOK Then
GoTo txtb
End If
End If
Next
Next
txtb:
End Sub
By the code you can understand that I am new to Coding / Programming. Thanks for you valuable time & Suggestions.