Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help on listboxes part 2???

mOskimOski Member Posts: 44
Once again I need help on the listboxes thinggies. I'm using 2 listboxes and 10 or more textboxes. Now my problem is that when an item was clicked on any of the listboxes, that item will be added to the textbox, than when another item was clicked, it will be added to next textbox, and so on.

My question was already answered by "Termc1224" and I'm very thankful but it seems that the code only works with 2 textboxes and the problem is I'm using 10 or more textboxes.... I think need to use a For Loop or something to make this work..... but I don't know how.... need help...

this is the code:

if text1.text = "" then
text2.text = list1.text
else
text1.text = list1.text
end if


thank you to those who will help...

Comments

  • Termc1224Termc1224 Member Posts: 84
    : Once again I need help on the listboxes thinggies. I'm using 2
    : listboxes and 10 or more textboxes. Now my problem is that when an
    : item was clicked on any of the listboxes, that item will be added to
    : the textbox, than when another item was clicked, it will be added to
    : next textbox, and so on.
    :
    : My question was already answered by "Termc1224" and I'm very
    : thankful but it seems that the code only works with 2 textboxes and
    : the problem is I'm using 10 or more textboxes.... I think need to
    : use a For Loop or something to make this work..... but I don't know
    : how.... need help...
    :
    : this is the code:
    :
    : if text1.text = "" then
    : text2.text = list1.text
    : else
    : text1.text = list1.text
    : end if
    :
    :
    : thank you to those who will help...
    :
    :

    Try creating an array of textbox
    then on the event click of listbox
    for ex of 10 textbox

    dim n as integer
    for n = 0 to 9
    if text1(n).text <> "" then
    text1(n+1).text = list1.text
    else
    text1(n).text = list1.text
    end if
    next

  • mOskimOski Member Posts: 44
    : : Once again I need help on the listboxes thinggies. I'm using 2
    : : listboxes and 10 or more textboxes. Now my problem is that when an
    : : item was clicked on any of the listboxes, that item will be added to
    : : the textbox, than when another item was clicked, it will be added to
    : : next textbox, and so on.
    : :
    : : My question was already answered by "Termc1224" and I'm very
    : : thankful but it seems that the code only works with 2 textboxes and
    : : the problem is I'm using 10 or more textboxes.... I think need to
    : : use a For Loop or something to make this work..... but I don't know
    : : how.... need help...
    : :
    : : this is the code:
    : :
    : : if text1.text = "" then
    : : text2.text = list1.text
    : : else
    : : text1.text = list1.text
    : : end if
    : :
    : :
    : : thank you to those who will help...
    : :
    : :
    :
    : Try creating an array of textbox
    : then on the event click of listbox
    : for ex of 10 textbox
    :
    : dim n as integer
    : for n = 0 to 9
    : if text1(n).text <> "" then
    : text1(n+1).text = list1.text
    : else
    : text1(n).text = list1.text
    : end if
    : next
    :
    :

    thank you soo much, the code worked, hehe, (^_^)

Sign In or Register to comment.