I’m a beginner in WinForms VB NET programming. I need to create text box at a run time.
I found example in a search engine how to implement this:
Private Sub Command1_Click()
Dim TextControl As TextBox
ControlID = ControlID + 1
Load Text1(ControlID)
Set TextControl = Text1(ControlID)
With TextControl
.Left = (Text1(ControlID - 1).Left + Text1(ControlID - 1).Width) + 10
.Top = 20
.Width = 100
.Height = 20
.Visible = True
End With
End Sub
But I have some difficulties with example’s code.
Would someone explain the following VB NET code rows?
Load Text1(ControlID)
Set TextControl = Text1(ControlID)
With TextControl
End With
You can check the following example that does exactly what you want to:
look for reference and good explanation: http://www.authorcode.com/create-dynamic-textbox-and-label-in-vb-net/