I am making a trading game for school and I have found myself in quite the conundrum.
I have two forms, my form1 is my main form and it has my balance textbox in it and it also has a textbox where it says money due. From this form you can open another form (form2) to get a loan.
In my form2 (loan) you can type in the amount you want to get and when you type in that amount it puts in 25% interest on that amount.
What I want to do is when you click the submit button, the amount you put into the textbox goes into your balance, and then the amount with interest goes into the money owed textbox.
What I can't figure out is how to pass these values from form2 to form1 to add to whatever values are already in those textboxes.
This is what I have when you click to open the loan form
private void loansToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.ShowDialog();
}
And this is what I have when you try and submit the values, it is unfinished but I am completely stuck on how to do this
private void button1_Click(object sender, EventArgs e)
{
Form1 testform = new Form1();
int tmp;
Int32.TryParse(textBox2.Text, out tmp);
testform.textBox39.Text = tmp.ToString();
this.Close();
}
Can anyone suggest any simple suggestions to do this?