Page 1 of 1

Tab control: How to add objects on different tabs

Posted: Tue Aug 20, 2013 8:43 pm
by Lifefree
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.

Tab control: How to add objects on different tabs

Posted: Tue Aug 20, 2013 10:56 pm
by Bob Hays
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. :)