I have a bassic understanding for dynmically adding controls to a form however I am having a hard time adding tabs to a tab control. Adding "a tab" with a name on it is simple enough but I can't seem to fiugre out how to add dynamic content to the tab once it's created.
Basically, I have a text file that has a list of names.
When my form loads, it reads that file and creates Tabs based on the names.
I then want to add, for example, a picture box and some labels and a text box, to the tabs.
The text file changes over time so should my tab control.
I don't even have any code to put here because I'm completely puzzled. The only thing I have is when my app is reading the text file I have a statement like this:
Tab.TabPages.Add(petName)
where petName is a string variable for the names of pets in the text file.
For my controls to add to the tab I have something like this:
Dim petPicture As New PictureBox
With petPicture
.Name = "picBox" & petName
.Size = New System.Drawing.Size(150, 150)
.Location = New System.Drawing.Point(14, 40)
.BackColor = Color.Black
.Enabled = True
.Visible = True
End With
Me.Controls.AddRange(New Control() {petPicture})
How do I get the above on my dynamically created Tab?
Thanks for any advice.
Basically, I have a text file that has a list of names.
When my form loads, it reads that file and creates Tabs based on the names.
I then want to add, for example, a picture box and some labels and a text box, to the tabs.
The text file changes over time so should my tab control.
I don't even have any code to put here because I'm completely puzzled. The only thing I have is when my app is reading the text file I have a statement like this:
Tab.TabPages.Add(petName)
where petName is a string variable for the names of pets in the text file.
For my controls to add to the tab I have something like this:
Dim petPicture As New PictureBox
With petPicture
.Name = "picBox" & petName
.Size = New System.Drawing.Size(150, 150)
.Location = New System.Drawing.Point(14, 40)
.BackColor = Color.Black
.Enabled = True
.Visible = True
End With
Me.Controls.AddRange(New Control() {petPicture})
How do I get the above on my dynamically created Tab?
Thanks for any advice.