Hi,
I have created a listbox, with a few buttons inserting items into the listbox.
Items Inserted are: "Up", "Down" and "Normal"
Now, what I am trying to do is, have another button, when clicked, it scrolls through the listbox, and if it's "Up" in the list, then does something, if "Down" then something Else, and if "Normal" then something else still.
The code I think which should work is:
The code seems perfect, but when I run the program, I get the following error:
"Cast from string "Up" to type 'Integer' is not valid."
I don't get why that error comes up, as I haven't declared "Up" as there's no need to.
Can anyone help me with this please? I have also tried If statements in there too.
Thanks
Ps, sorry if this is in the wrong forum - I'm new to VB and so werent too which forum to put it in, but seems relevent.
I have created a listbox, with a few buttons inserting items into the listbox.
Items Inserted are: "Up", "Down" and "Normal"
Now, what I am trying to do is, have another button, when clicked, it scrolls through the listbox, and if it's "Up" in the list, then does something, if "Down" then something Else, and if "Normal" then something else still.
The code I think which should work is:
Code:
While lbList.Items.Item("Up")
Do
PictureBox.Left += 1
Loop
End While
"Cast from string "Up" to type 'Integer' is not valid."
I don't get why that error comes up, as I haven't declared "Up" as there's no need to.
Can anyone help me with this please? I have also tried If statements in there too.
Thanks
Ps, sorry if this is in the wrong forum - I'm new to VB and so werent too which forum to put it in, but seems relevent.