private void SelectAnotherProductButton_Click(object sender, EventArgs e) { this.Hide(); SelectForm SF = new SelectForm(); SF.Show(); }
private void StartNewOrderButton_Click(object sender, EventArgs e) { this.Hide(); SelectForm SF = new SelectForm(); SF.Show(); }
/// <summary> /// Select another product button click event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SelectButton_Click(object sender, EventArgs e) { SelectForm mySelectForm = new SelectForm(); mySelectForm.Show(); this.Close(); }
//button to start a new order private void _NewOrderButton_Click(object sender, EventArgs e) { SelectForm selectForm = new SelectForm(); selectForm.PreviousForm = this; selectForm.Show(); this.Hide(); }
private void SelectAnotherProductButton_Click(object sender, EventArgs e) { SelectForm selectForm = new SelectForm(); selectForm.Show(); this.Hide(); }
private void StartNewOrderButton_Click(object sender, EventArgs e) { //opening select form when start button is clicked SelectForm selectForm = new SelectForm(); selectForm.previousForm = this; selectForm.Show(); this.Hide(); }
private void AnotherProductButton_Click(object sender, System.EventArgs e) { SelectForm form = new SelectForm(); form.Show(); form.previousForm = this; form.DisplayProduct(); this.Hide(); }
private void ButtonNewOrder_Click(object sender, System.EventArgs e) { // Switch forms SelectForm selectForm = new SelectForm(); selectForm.previousForm = this; selectForm.Show(); this.Hide(); }
private void selectAnotherProductToolStripMenuItem_Click(object sender, EventArgs e) { SelectForm selectForm = new SelectForm(); //Save a reference to the current form in a property of the nextForm //Show the next Form selectForm.Show(); //Hide this form! this.Hide(); }
private void Select_button_Click(object sender, EventArgs e) { SelectForm selectForm = new SelectForm(); //Save a reference to the current form in a property of the nextForm //Show the next Form selectForm.Show(); //Hide this form! this.Hide(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); aboutForm = new AboutForm(); product = new Product(); orderForm = new OrderForm(); selectForm = new SelectForm(); splashForm = new SplashForm(); productInfoForm = new ProductInfoForm(); dollar = new Dollar(); Application.Run(new SplashForm()); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Instantiate the forms spalshForm = new SpalshForm(); orderForm = new OrderForm(); productInfoForm = new ProductInfoForm(); selectForm = new SelectForm(); startForm = new StartForm(); aboutBox = new AboutBox(); product = new Product(); Application.Run(new SpalshForm()); }
/// <summary> /// This method handles all the button clicks and perform their case accordingly /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _buttonClickHandler(object sender, EventArgs e) { Button ClickHandler = sender as Button; switch (ClickHandler.Tag.ToString()) { /// Shows the selection form and hide start form case "New": // Instantiate an object to the next form SelectForm selectForm = new SelectForm(); // Pass a reference to the current form to the next form selectForm.startForm = this; // Show the next form selectForm.Show(); // Hide the form this.Hide(); break; /// Shows the ProductInfoForm and hide current form case "Open": // Instantiate an object to the next form ProductInfoForm productInfoForm = new ProductInfoForm(null); // Pass a reference to the current form to the next form productInfoForm.startForm = this; // Show the next form productInfoForm.Show(); // Hide the form this.Hide(); break; /// Ask confirmation message to exit if OK case "Exit": // showing up confirm message when cancel button clicked DialogResult result = MessageBox.Show("Are You Sure you want to exit?", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); // Closes the program if OK clicked if (result == DialogResult.OK) { Application.Exit(); } break; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); splashform = new SplashForm(); startform = new StartForm(); selectform = new SelectForm(); orderform = new OrderForm(); aboutform = new AboutBox(); product = new Product(); productInfo = new ProductInfo(); Application.Run(splashform); }
/// <summary> /// This event handler handles all button clicks /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _buttonClickHandler(object sender, EventArgs e) { Button ClickHandler = sender as Button; switch (ClickHandler.Tag.ToString()) { case "Another": // Instantiate an object to the next form SelectForm selectForm = new SelectForm(); // Pass a reference to the current form to the next form selectForm.productInfoForm = this; // Show the next form selectForm.Show(); // Hide the form this.Hide(); break; case "Cancel": // showing up confirm message when cancel button clicked DialogResult result = MessageBox.Show("Are You Sure you want to exit?", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); // Closes the program if OK clicked if (result == DialogResult.OK) { Application.Exit(); } break; case "Next": // Instantiate an object to the next form OrderForm orderForm = new OrderForm(_productDetails); // Pass a reference to the current form to the next form orderForm.productInfoForm = this; // Show the next form orderForm.Show(); // Hide the form this.Hide(); break; } }
// Click event handler for the buttons on the StartForm private void _StartFormButtonClickHandler(Object sender, EventArgs e) { // cast the sender object to type Button Button buttonClicked = sender as Button; switch (buttonClicked.Tag.ToString()) { case "new order": // create an instance of the SelectForm SelectForm selectForm = new SelectForm(); // hide the StartForm this.Hide(); // show the SelectForm selectForm.Show(); break; case "saved order": // create an instance of the ProductInfoForm ProductInfoForm productInfoForm = new ProductInfoForm(null); // hide the StartForm this.Hide(); // show the ProductInfoForm productInfoForm.Show(); break; case "exit": // exit the application // confirm the closure DialogResult result = MessageBox.Show("Are you sure you want to exit the application?", "Confirm Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { Application.Exit(); } break; } }
// Shared click event handler for Select Another product private void _SelectAnotherProduct(Object sender, EventArgs e) { // if the SelectForm's reference has been defined, i.e., the ProductInfoForm was generated from the SelectForm if (selectForm != null) { // show the previously hidden selectForm selectForm.Show(); // Close this ProductInfoForm, since a new ProductInfoForm will be generated through the SelectForm this.Close(); } else { // else is selectForm == null; therefore the ProductInfoForm was created directly from the StartForm // instantiate a new instance of the SelectForm selectForm = new SelectForm(); // show the new select form selectForm.Show(); // Close this ProductInfoForm, since a new ProductInfoForm will be generated through the SelectForm this.Close(); } }