form f2 = new Form2(account);
f2.ShowDialog();
In the form-class f2 I have a button where I write what I want to withdraw from the account.
private void withDraw_Click(object sender, EventArgs e
{
deposit = Int.Parse(txtDeposit.Text);
}
The constructor:
public Form2(int account) { InitializeComponent(); account = account + deposit; }
What I want is to write the amount to deposit in the account in the textbox.
That amount I want to add to the account-variable.
Then I want to return the account to the mainform.
But I dont now how to do that or maybe I could use some global variable?