I am using the following code to create text boxes at run time and it’s working perfectly:
MarginTextbox.Name = "mid" & id
MarginLabel.Name = "ML" & id
MarginTextbox.Font = New System.Drawing.Font("Verdana", 10, Drawing.FontStyle.Regular)
MarginLabel.Location = New Point(15, (80 + (counter * 24)))
MarginTextbox.Location = New Point(110, (80 + (counter * 24)))
MarginLabel.BackColor = Me.BackColor
MarginTextbox.Size = New Size(56, 20)
MarginLabel.Size = New Size(150, 20)
MarginTextbox.AutoSize = False
MarginLabel.Text = "Supplier " & id
Controls.Add(MarginTextbox)
Controls.Add(MarginLabel)
I don’t want to place them on the form, but rather in a TabControl tab. How can I do that?
A TabControl contains one or more TabPage.
The TabPage has a Controls object collection that can be used to add your textboxes.
So (supposing you have added a TabControl named tabControl1):