Heres part of the code, maybe then you can see more of what Im trying to do
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication11
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
newOrder = new Order();
for (int i = 0; i < newOrder.menuEntree.Length; i++)
{
this.listBoxEntree.Items.Add(newOrder.menuEntree[i]);
}
for (int i = 0; i < newOrder.menuEntree2.Length; i++)
{
this.menuEntree2.Items.Add(newOrder.menuEntree2[i]);
}
}
private void listBoxEntree_SelectedIndexChanged(object sender, EventArgs e)
{
newOrder.Entree = this.listBoxEntree.Text;
if (this.listBoxEntree.SelectedItems.Contains("Tea"))
{
comboBox2.Visible = true;
label2.Visible = true;
}
newOrder.Entree = this.listBoxEntree.Text;
if (this.listBoxEntree.SelectedItems.Contains("Coffee"))
{
comboBox2.Visible = true;
label2.Visible = true;
}
}
private void menuDisplayOrder_Click(object sender, EventArgs e)
{
MessageBox.Show(newOrder.Entree + "\n"
+ newOrder.ExtrasSelection
+ "\n"
+ newOrder.Entree2
+ "\n"
+ "Current Order");
}
private void comboBox2_KeyPress(object sender, KeyPressEventArgs e)
{
newOrder.ExtrasSelection = this.comboBox2.Text;
}
private void menuClearOrder_Click(object sender, EventArgs e)
{
this.listBoxEntree.ClearSelected();
this.menuEntree2.ClearSelected();
this.comboBox2.SelectedIndex = -1;
this.comboBox2.Text = " ";
newOrder.Entree = " ";
newOrder.Entree2 = " ";
newOrder.ExtrasSelection = " ";
comboBox2.Visible = false;
label2.Visible = false;
newOrder.DetermineTotalCharges().ToString("");
}
private void menuSubmitOrder_Click(object sender, EventArgs e)
{
MessageBox.Show(newOrder.Entree + "\n" +
newOrder.ExtrasSelection + "\n" + newOrder.Entree2 + "\n\n\n" + "Total: " +
newOrder.DetermineTotalCharges().ToString("C"), "Order Submitted");
}
private void menuExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
newOrder.ExtrasSelection = this.comboBox2.Text;
}
private void menuEntree2_SelectedIndexChanged(object sender, EventArgs e)
{
newOrder.Entree2 = this.menuEntree2.Text;
}
}
}