1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

TextBox, Index & Arraylist

Discussion in 'Questions (Windows Mobile)' started by Peptone, Nov 19, 2007.

  1. Peptone

    Peptone New Member

    Good Afternoon to everybodies! :cool:

    I've a little problem, obviously.

    I've 81 TextBox and I need to write everyone at same time using a For cicle.
    In VB6 I can draw every TextBox with same name and use an index (Index).
    I don't find that in Basic4ppc... I suppose using ArrayList but I don't know this object :sign0013:

    If I was 3 TextBox1:

    It should have to sound so (this code is a mix between B4ppc and Index like VB6):

    Sub Button1_Click
    For i =0 to 2
    TextBox1(i).Color = cRed
    Next i
    End Sub

    Sub Button2_Click
    For i =0 to 2
    TextBox1(i).Color = cGreen
    Next i
    End Sub

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. BjornF

    BjornF Active Member Licensed User

    Dear Peptone,

    you can use the Control keyword (see the helpfile)

    In your example you could have three different textboxes

    and then change the color as below

    Sub Button1_Click
    For i =1 to 3
    Control("TextBox"&i).Color = cRed
    Next i
    End Sub

    and so on.

    all the best / Björn

    Arrgh, too late... Erel, you got there first as usual
  4. Peptone

    Peptone New Member

    Thanks a lot!

    It's more simple than I belived!

    ... and more simple then VB too!
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice