[Gambas-user] Still jacking with tabstrips properties and adding tabs

M0E Lnx m0e.lnx at ...626...
Wed Aug 13 18:01:59 CEST 2008


I tried that, and for some reason it doesnt work here
In my head it always made sense like that, keeps giving me an new tab
but sets the .text ("New Tab") property to the one before the last

I still dont understand why it does that



On Wed, Aug 13, 2008 at 10:33 AM, Ron Onstenk <ronstk at ...239...> wrote:
> On Wednesday 13 August 2008, M0E Lnx wrote:
>> Thanks... i found a way to fix this by declaring an additional integer
>> variable and assigning it's value before the WITH statement.
>>
>> goes like this
>>
>> for i = 0 to array.count - 1
>> idx = tabstrip1.count - 1
>>
>> with tabstrip1
>> .count = .count + 1
>> .index = idx
>> .text = "New Tab"
>> end with
>>
>>
>>
>>
>> On Tue, Aug 12, 2008 at 6:06 PM, Ron Onstenk <ronstk at ...239...> wrote:
>> > On Tuesday 12 August 2008, M0E Lnx wrote:
>> >> With tabstrip1
>> >> .count = .count + 1 ' this works... adds a new tab to the tabstrip
>> >> .index = .count ' This is where the problem is, it keeps saying bad index
>> >> End With
>> >>
>> >
>> >
>
> No need for extra variable or for/next loops.
>
> In your first example where you got 'bad index' its
> just that .count gives the total tabs, the index of
> the last one equals simple .count-1
>
> Your second example say .index = idx and above that one you said
> idx = tabstrip1.count - 1. You see it is effective the same?
> So the only change you had to do was:
>
>  with tabstrip1
>  .count = .count + 1
>  .index = .count - 1  '  <---just adding - 1
>  .text = "New Tab"
>  end with
>
>
> Ron 1st
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list