Page 1 of 1

How to use TabControl???

Posted: Mon Sep 01, 2008 8:13 pm
by marcuslee
I just found fnxBasic the other day.  It looks promising.  I like the small file size.  That`s what I have been looking for as well as something free.  I like that, too.  I`ve used Liberty Basic in the past.  I like it too, and it isn`t too expensive, but the DLL files needed with a program makes even the smallest programs a few MEGs in size ... that`s too big.  Anyway, on with my problem ...

Right now, I am trying to figure out how to use TabControl object.  I can get it to appear, and I have figured out how to change the settings, but I can`t get the OnChange to work.  I`m probably not building the Sub correctly.  Could someone give me a hint, or show me some example code. (By the way, that is what the help file is missing, examples!)

Mark

How to use TabControl???

Posted: Mon Sep 01, 2008 8:48 pm
by marcuslee
I think that I have figured it out on my own. ?Feedback is still welcome, though. ?Here`s the code I have right now:

[code]
object myform as form
     caption="progressbar in statusbar"
     object Tabs as tabcontrol
           onChange=testing
           Align = AlTop
                     Height = 25
           Tabs(0)="Test"
           Tabs(1)="Test 2"
? ?
                 
     end object
     object LabelA as Label
                     top = 100
                     AutoSize = True
     end object
end object

myform.ShowModal


Sub testing()

IF Tabs.tabindex = 0 then LabelA.caption = "Tab 1"
IF Tabs.tabindex = 1 then LabelA.caption = "Tab 2"

End Sub
[/code]

P.S. - Is it just me or does the "code" tag not work with this forum?

How to use TabControl???

Posted: Tue Sep 02, 2008 7:28 am
by PaPi
Hi Mark, it is the sample for you:

[code]
tabcon.bas by PaPi 01.09.2008

object myform as form
    caption="tabcontrol test"
     myform.AutoSize=true
    object Tabs as tabcontrol
           width=400:height=200
          onChange=testing

          Tabs(0)="Test 1"
`      .
`      .
` you can to place here others object in tabs(0)
`      .
`      .
`      for example this:
                 object label0 as label
                       top=30 :left=10`:width=tabs.width/2-5 : height=tabs.height-5
                       visible=false
                       Color=&h80FF80
                       caption=" This is the tab Test1"
                 end object ` label2

         Tabs(1)="Test 2"
`      .
`      .
`  you can to place here some object in tabs(1)
`      .
`      .
`      for example this:
             object label1 as label
                       top=40 :left=tabs.width/2`:width=tabs.width/2 -5: height=tabs.height-5
                       visible=false
                       color=&h8080FF
                       caption="This is the tab Test2"
                 end object ` label1
     
    end object ` tabs

end object `myform

myform.ShowModal


Sub testing()
     IF Tabs.tabindex = 0 then
            label0.visible=true
     else
           label0.visible=false
     end if
     
     IF Tabs.tabindex = 1 then
            label1.visible=true
     else
           label1.visible=false
     end if

End Sub
[end code]

PaPi