I need to grab a level item from a list box.....

May 16 2009 10:46 PM
I need to grab a level item from a list box, in my program I have selected "Bad armor of the Tiger Level 23", My loop searches for the first number then stops so this will make the item level 2, It needs to grab the second number so it makes the item level 23!

Code is as follows:

            // Do the level searcher
            if (lisInv.SelectedItem != null)
            {
                do
                {
                    if (lisAInventory.Contains(Convert.ToString(t)))
                    {
                        // Get out of the loop
                        x = t;

                        // Level1 is the first digit
                        itemlevel = t;
                    }
                    t++;
                } while (x == 0);
            }

Should I do a loop then some how fix up for it to grab what ever numbers are ahead after level?

Answers (1)