list box items as input

  • Thread starter Thread starter portroe
  • Start date Start date
P

portroe

in VB .net

how do I arrange that the items in a list box will be used in
calculations in a formula,

thanks in advance
 
Hi Portroe,

Let the user select the row(s) and calculate with the item(s) the user has
selected.

That can with the click event from a button (multiselect) or just with an
event from the listbox, by example selected itdex changed

I hope this helps a little bit.

Cor
 
Hi Portroe,

I thought yes in a multiselect, therefore you can have to look for the
selectedItems property

Cor
 
* portroe said:
how do I arrange that the items in a list box will be used in
calculations in a formula,

What's your exact problem? Selecting the items, calculating, ...?
 
* portroe said:
can you possbly do this with a for... next loop, item by item?

Set the control's 'SelectionMode' property to 'MultiExtended', then you
can use this code:

\\\
Dim Sum As Integer
For Each i As Integer In ListBox1.SelectedItems
Sum += i
Next i
MsgBox(Sum.ToString())
///
 
my problem is selecting the items which are sitting in a listbox,

I then want process each item inside a for... next loop to , with a
formula, placing each result in the next list box,

thanks

portroe
 
* portroe said:
my problem is selecting the items which are sitting in a listbox,

I then want process each item inside a for... next loop to , with a
formula, placing each result in the next list box,

You can select items programmatically by calling
'listbox1.SetSelected(<item index>, True)'.
 
Back
Top