code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PersonalInformationApp { public partial class MainUI : Form { public MainUI() { InitializeComponent(); } private string firstName, lastName, fathersName, mothersName, address; private void AddressButton_click(object sender, EventArgs e) { MessageBox.Show(address); } private void parentsButton_click(object sender, EventArgs e) { fathersNameTextBox.Text = fathersName; mothersNameTextBox.Text = mothersName; MessageBox.Show("Fathers Name: " + fathersName + "\n" + "Mothers Name: " + mothersName); } private void saveButton_Click(object sender, EventArgs e) { firstName = firstNameTextBox.Text; lastName = lastNameTextBox.Text; fathersName = fathersNameTextBox.Text; mothersName = mothersNameTextBox.Text; address = addressTextBox.Text; firstNameTextBox.Text = ""; lastNameTextBox.Clear(); fathersNameTextBox.Text=string.Empty; mothersNameTextBox.Text = string.Empty; addressTextBox.Text = null; } private void showAllInformationButton_Click(object sender, EventArgs e) { firstNameTextBox.Text = firstName; lastNameTextBox.Text = lastName; fathersNameTextBox.Text = fathersName; mothersNameTextBox.Text = mothersName; addressTextBox.Text = address; } private void nameButton_Click(object sender, EventArgs e) { MessageBox.Show(firstName+" "+lastName); } } }