How to declare all listbox items as integers. (Visual Studio)(Visual Basic)

  • Thread starter Thread starter ChristianTellierVB
  • Start date Start date
C

ChristianTellierVB

Guest
My program contains 6 listboxes, one has values 1000 - 1025, those value will be decomposed into their respective digit placement, 1rst listbox = for 1rst digits, 2nd listbox = for 2nd digits... The final is the reassembly of the decomposed values.

[1025] [1] [0] [2] [5] [1025] [ ] = Listbox

My problem is, my code works for numbers indiviudally with a textbox, i need it to be converted so it can decomposed all items in a list box. Can anyone help me?

My program works like this:

TextBox = [1025]

Label = [First digit : 1 , Second digit : 0, Third digit : 2, Last digit : 5]

It can separate invdivual numbers, I need it so it can run throwout all numbers inserted in a listbox.

For Dividing numbers that contain four digits I use this part of code:

number = TextBox1.Text

Digit1 = number \ 1000
number = number Mod 1000
Digit2 = number \ 100
number = number Mod 100
Digit3 = number \ 10
number = number Mod 10
Digit4 = number

Then its passed threw a If Statement to figure out if its a four digit value, 3 digit value... And displays it. Using something like this:

ElseIf (NumberInserted > 1000) And (NumberInserted < 9999) Then
Call SeperateFourDigits(NombreInscrit, Thousands, Hundreds, Tens, Units)
Me.lblDigits.Text = "Digit 1 :" & Thousand & vbCrLf &
"Digit 2: " & Hundred & vbCrLf &
"Digit3 : " & Tens & vbCrLf &
"Digit4: " & Units

My full code that was a translation from french to english (so exuse grammaire mistakes) and is very incomplete is:

Google Docs - create and edit documents online, for free.

Thanks to anyone that can help, any more information on the code just ask.

Continue reading...
 
Back
Top