Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. dynamically create picture control with tab

dynamically create picture control with tab

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shinay
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • S shinay

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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 the Controls 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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups