phil

phil

  • NA
  • 1
  • 0

Help needed with VB.NET code

Feb 11 2007 3:38 PM
I need some help with a program im trying to code. The form consists of a listbox and three texts boxes and a button.

Two texts boxes will be to enter a start value and an end value. The other will be for a multiplier value.
 
For example if a user enters 5 into the start textbox and 30 in the end textbox, with 2 for the muliplier value.

It will produce this output in the listbox

543210
10 9 8 7 6 5 4 3 2 1 0
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
etc

Here is my coding so far but its not working. Please could someone help. Thanks


Dim Startval As Integer

Dim Maxval As Integer

Dim Mulitiplier As Integer

 

Dim temp As Integer

Dim line As String

Mulitiplier = txtMultiplier.Text

Startval = Startval * Mulitiplier

Startval = txtStartVal.Text

Maxval = txtMaxVal.Text

temp = Startval

line = ""

 

While Startval <= Maxval

temp = Startval

line = ""

For temp = Startval To 0 Step -1

line = line & temp & ""

ListBox1.Items.Add(line)

Next temp

End While