TabControl on FormExDesktop?

cactus

Member
Licensed User
Longtime User
Hi,

I'm struggling to get TabControl to work on a FormExDesktop form. Struggling as in can't get it to work. Anyone got an example for me?

TIA,

Cheers,
/Cacti
 

agraham

Expert
Licensed User
Longtime User
Look at line 61 in the region "Build FormEx1" in the FormEx demo. Here's the demo from the ControlsEx help.

You can either add the Tab control to the donor Form then "steal" it with FormEx.AddControl
B4X:
Sub App_Start
      FormEx1.New1("Form1")
      AddButton("Form1","Button1",0,0,80,40,"Button1")
      AddTextBox ("Form1","TextBox1",40,20,100,25,"")
      tbc.New1 ("Form1", 10,10, 200, 200)
      tbc.AddTabPage("Page1")
      tbc.AddTabPage("Page2")
      tbc.AddTabPage("Page3")
      tbc.AddControl("Button1",0,20,20)
      tbc.AddControl("TextBox1",1,20,30)
      FormEx1.AddControl(tbc.ControlRef)
      FormEx1.Run
End Sub

Or add the Tab control directly to the FormEx.
B4X:
Sub App_Start
      FormEx1.New1("Form1")
      AddButton("Form1","Button1",0,0,80,40,"Button1")
      AddTextBox ("Form1","TextBox1",40,20,100,25,"")
      tbc.New1 (FormEx1.ControlRef, 10,10, 200, 200)
      tbc.AddTabPage("Page1")
      tbc.AddTabPage("Page2")
      tbc.AddTabPage("Page3")
      tbc.AddControl("Button1",0,20,20)
      tbc.AddControl("TextBox1",1,20,30)
      FormEx1.Run
End Sub
 
Top