private void button4_Click(object sender, EventArgs e) { this.Hide(); MainForm frm = new MainForm(); frm.Show(); }
private void button3_Click(object sender, EventArgs e) { string filePath = textBox1.Text; string savePath = textBox2.Text; string bank = BankActivityForm.GetItemText(BankActivityForm.SelectedItem); if ( filePath != null && savePath != null) { //Change the cursor to a wait cursor Cursor.Current = Cursors.WaitCursor; this.label4.Text = "Please wait while the program does it's job..."; //Run the program with a try clause for errors try { MainProgram.Start(filePath, savePath, bank); } catch { MessageBox.Show("There was an error running the program please try again."); } MessageBox.Show("The program has completed it's task"); } else { MessageBox.Show("You have not selected a file to open, or to save"); } //Return to main form this.Hide(); MainForm frm = new MainForm(); frm.Show(); //Switch back to default cursor Cursor.Current = Cursors.Default; this.label4.Text = "Done..."; }