4
Contributors
11
Replies
13
Views
5 Years
Discussion Span
Last Post by HibaPro
0

Can you give us an example of what you are trying to do? Can you list a simple case with the contents of two comboboxes and what you want to see as a result?

Edited by Reverend Jim

0

Multiply?
Do you mean, when you select an item on comboBox1, you ADD this item to comboBox2?
Is fo, use Add() method.

comboBox2.Items.Add(comobBox1.SelectedItem)
0

i have one combobox that have an price item and the other one have an QTY i need to multiply each item the show the result of sum in textbox , can anyone help plx
thx before :D

0

Hi,

You could do something like this:

TextBox1.Text = Val(ComboBox1.SelectedItem) * Val(ComboBox2.SelectedItem)
0

hi luc001 , can u tell me how i can do inside a loop to make all item multply then take the sum of all, TY

0

Hi HibaPro,

can someone tell how i can multiply the items of combobox to onther one using vb.net

What are you trying to create and what do you have so far?

0

i want to calculate the total cost of Eq from two combobox
my code is
Dim sum As Integer

    For j = 0 To Me.ComboBox8.MaxLength

        sum += ComboBox8.SelectedValue * ComboBox9.SelectedValue

Next

    totalallcosttxt.Text += sum

    but its calculate for the selected item not for all item or value 

    i try to do this from datagridview but i cant arrive to the clos value , can u help plz 
0

Hi,

The ComboBox is a combination of a TextBox and a ListBox. The ComboBox displays an editing field (TextBox) combined with a ListBox allowing us to select from the list or to enter new text.
That means that you only can calculate the selected items in both your comboboxes.

0

thx to guide me , but i would like to ask u if there is a method to calculate the total sum from datagridview

0

Thr following code assumes integer values in columns 0 and 1 of a datagridview. It calculates column0 + column1 and puts the result in column2. Use CDbl for floating point values. To calculate the total sum just keep a running total of the values in column2

For Each row As DataGridViewRow In DataGridView1.Rows
    row.Cells(2).Value = CInt(row.Cells(0).Value) + CInt(row.Cells(1).Value)
Next

Edited by Reverend Jim

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.