Hello!
Ok so I am trying to make a simple program that will allow the use of a combobox and an array.
I am using an combobox as a dropdownlist with the 'products' selected.
My question is I am having problems getting to quanity/total items... and using the listbox to 'sum' the total?
Here is the code... kinda goofy/simple question but my head hurts!
Any help or suggestions would be highly helpful. I have commented the areas of help and labelled everything approperatly.
Thanks danielle
namespace
WindowsApplication1
{
public partial class Form1 : Form
{
string[] listOfCourses = new string[5];
decimal[] listOfInstructos = new decimal[5];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//
//my array
//
listProducts[0] =
"Word";
listProducts[1] =
"Excel";
listProducts[2] =
"Frontpage";
listProducts[3] =
"Access";
listPrices[0] = 10.00m;
listPrices[1] = 20.00m;
listPrices[2] = 30.00m;
listPrices[3] = 40.00m;
cboBoxProduct.DataSource = listProducts;
cboBoxPrice.DataSource = listPrices;
cboBoxProduct.SelectedIndex = -1;
cboBoxPrice.SelectedIndex = -1;
}
private void cboBoxProduct_SelectedIndexChanged(object sender, EventArgs e)
{
cboBoxPrice.SelectedIndex = cboBoxProduct.SelectedIndex;
}
private void btnAddProduct_Click(object sender, EventArgs e)
{
listBox1.Items.Add(cboBoxProduct.SelectedItem);
listBox2.Items.Add(cboBoxPrice.SelectedItem);
}
private void btnTotal_Click(object sender, EventArgs e)
{
//struggling here
//
listBox4.Items.Add(listBox2.Text);
//
// struggling here, wanting this button to give me total as in the total cost of purchase...
// wanting my third list box to have the quanity of order and update without repeat items in list box.
// I know my program is simple but I am learning so give me time...
}
}
}