I am making a WinForms application in VB.NET and part of it has a questionnaire in it. I am trying to use a Table Layout Panel to display the question and the answer box which come from a database.
I thought a good way to name the Labels and Textboxes would be to use a For loop and have each question number appeanded to it.
e.g
For i = 1 To NumOfQuestions
Dim TxtboxQ & i As New TextBox
Next
which would output
Dim TxtboxQ1 As New TextBox
Dim TxtboxQ2 As New TextBox
Dim TxtboxQ3 As New TextBox
etc.
Is it possible to do this?
I thought a good way to name the Labels and Textboxes would be to use a For loop and have each question number appeanded to it.
e.g
For i = 1 To NumOfQuestions
Dim TxtboxQ & i As New TextBox
Next
which would output
Dim TxtboxQ1 As New TextBox
Dim TxtboxQ2 As New TextBox
Dim TxtboxQ3 As New TextBox
etc.
Is it possible to do this?
Last edited: