how do i make it so that when the user enters a number in the textbox, clicks an addition button, puts the second operand in the same textbox, then display the result in the textbox when the add button is clicked again?
here is my code for the add button:
private void add_Click(object sender, RoutedEventArgs e)
{
if (z == (int)MODE.rec)
{
real1 = Convert.ToDouble(x.Text);
this.x.Focus();
real2 = Convert.ToDouble(x.Text);
sum1 = real1 + real2;
sum2 = imag1 + imag2;
s = sum1.ToString("0.000000");
t = sum2.ToString("0.000000");
x.Text = "" + s;
y.Text = "" + t;
}
}