private void button1_Click(object sender, EventArgs e) { try { WriteTxt wr = new WriteTxt(); wr.WriteText(textBox1.Text); MessageBox.Show("Info saved!", "Message"); } catch (Exception ex) { MessageBox.Show("Error!"); } }
//Saves the textbox text on a txt file using a function from WriteTxt class. private void button3_Click(object sender, EventArgs e) { try { WriteTxt wr = new WriteTxt(); wr.WriteText(textBox3.Text); MessageBox.Show("Information saved! ", "Message"); } catch (Exception ex) { MessageBox.Show("Error while printing."); } }