Question to b answered in 10 minutes or less

  • Thread starter Thread starter Erik
  • Start date Start date
E

Erik

Ok. I have a project that figures out payments of an
item. I just can't find the code to only get rid of the
negative balance in my list box if there is a negative
balance. Help Please.
 
Erik said:
Ok. I have a project that figures out payments of an
item. I just can't find the code to only get rid of the
negative balance in my list box if there is a negative
balance. Help Please.

Well this sort of thing is simple enough. Wire up an event to the ListBox
change event. In the sub for that event, Dim a Decimal, assign it the value
of Decimal.Parse(ListBox.SelectedItem.Value) and if the value < 0 reset the
value to the desired positive value.

R.
 
* "Erik said:
Ok. I have a project that figures out payments of an
item. I just can't find the code to only get rid of the
negative balance in my list box if there is a negative
balance. Help Please.

What's the problem?

You can convert an item to a number:

\\\
Dim d As Double = Double.Parse(DirectCast(Me.ListBox1.Items(1), String))
///

You can remove an item using 'ListBox1.Items.Remove(...)'.
 
Back
Top