Tab control: How to add objects on different tabs

In this category you can exchange your programming questions and solutions.
Post Reply
Lifefree
Posts: 9
Joined: Tue Feb 07, 2012 9:49 pm

Tab control: How to add objects on different tabs

Post: # 1104Post Lifefree
Tue Aug 20, 2013 8:43 pm

Is that only bitmaps are allowed?
I tried to put a button (or any object) over a tab, but it seems to be put over the form as its parent window.
Can an object be put over an active (selected) tab?
Or to define and active tab to put an object over the child area of the tab not the form.
I see no examples of using tabs. and no discussion at the forum.
Best regards.

Bob Hays
Posts: 26
Joined: Sun Oct 03, 2010 4:49 pm

Tab control: How to add objects on different tabs

Post: # 1105Post Bob Hays
Tue Aug 20, 2013 10:56 pm

You create a separate hidden panel for each tab placing all panels in the same place.
Your objects then go on the panels.

you create a subroutine to change which panel you want visible selected by the onchange method.
object  tabs as tabcontrol
...
onChange = changepanel
...
end object
sub changepanel(t as tabcontrol)
  panel1.visible = false
  panel2.visible = false
  panel3.visible = false

  select case t.tabindex
    case 0
      panel1.visible = true
    case 1
      panel2.visible = true
    case 2
      panel3.visible = true
  end select
end sub

Hope this helps. :)

Post Reply