dynamically create picture control with tab
-
How to dynamically add tab and picture control as a pair? I tried something like the following. but it didn't show each picture control on each tab. For i = 1 To 5 Load Picture1(i) Load TabStrip1(i) Picture1(i).Visible = True Picture1(i).Left = Picture1(i).Left + 100 tab Next i how can i achieve this. I am using vb6
-
How to dynamically add tab and picture control as a pair? I tried something like the following. but it didn't show each picture control on each tab. For i = 1 To 5 Load Picture1(i) Load TabStrip1(i) Picture1(i).Visible = True Picture1(i).Left = Picture1(i).Left + 100 tab Next i how can i achieve this. I am using vb6
My VB6 is pretty rusty, but here goes...
Load
only loads forms, not controls. What you have to do is create a new instance of the control you want, then add it to theControls
collection of the form/control you want to host the new control. In your case, you want to make a new Tab, not a TabStrip, add it to the TabStrip's Tabs collection.Dim newTab As New Tab
newTab.Name = "Tab3"
newTab.Caption = "My New Tab"
TabStrip1.Tabs.Add(newTab)Adding the PictureBox control is done just about the same way.
Dim newPicBox As New PictureBox
newPicBox.Width = ...
newPicBox.Height = ...
newPicBox.Left = ...
newPicBox.Top = ...
newPicBox.Name = "PictureBox3"
Form1.Controls.Add(newPicBox)RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome