473,513 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

list box items as input

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

Nov 20 '05 #1
7 1723
Cor
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

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

Nov 20 '05 #2
Hi Cor,

can you possbly do this with a for... next loop, item by item?

thanks

Portroe

Cor wrote:
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

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



Nov 20 '05 #3
Cor
Hi Portroe,

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

Cor

can you possbly do this with a for... next loop, item by item?

Nov 20 '05 #4
* portroe <bo*@sleigh.com> scripsit:
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())
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* portroe <bo*@sleigh.com> scripsit:
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, ...?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
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

Herfried K. Wagner [MVP] wrote:
* portroe <bo*@sleigh.com> scripsit:
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, ...?


Nov 20 '05 #7
* portroe <bo*@sleigh.com> scripsit:
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)'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7513
by: Simon | last post by:
Hi, I'm hoping you could show me examples of how a functional/declarative language could be used to consicely describe resticted subsets of elements. I'm looking for a 'specification' style...
1
2058
by: NickB | last post by:
Please could someone tell me what is wrong. Ther error is: An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll Additional information: Object...
6
3071
by: massimo | last post by:
Hey, I wrote this program which should take the numbers entered and sort them out. It doesnąt matter what order, if decreasing or increasing. I guess I'm confused in the sorting part. Anyone...
4
1585
by: Rick | last post by:
I want to add items to a list and then submit these items via POST in a form. Below is my code and it adds the items fine but they are not selected when I submit the form how can I have them all...
3
3106
by: Jeremy Owens-Boggs | last post by:
We are trying to implement a dual list box selection where you have two list boxes, You highlight items in the right side list box, click a button and this moves those items over to the left hand...
3
8517
by: Kriston-Vizi Janos | last post by:
Dear Mr. Kern, and Members, Thank you very much for the fast answer, my question became over-simplified. My source code is appended below. It uses two text files (L.txt and GC.txt) as input...
1
1826
by: puja | last post by:
hi all, I have a form which has checkbox list which has items as below 1) Input 1 2) Input 2 3) Input 3 4) Input 4 5) Input 5
6
7961
by: Michael McGarry | last post by:
Hi, Please excuse me if this is not the right forum for this question. I would like to create a random permutation of a list of numbers. How can I do this in C? I was just going to draw a...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.