Dude that's way to complicated for you. It's way too early. If you want to store it or something you need to learn a little bit more, just do easy shit like this
Code:
public void button1_Click(object sender, RoutedEventArgs e){
int firstbox = Convert.ToInt32(textBox1.Text); //here you input first value
int firstvalue = textBox1.Text; // this is to store the first value you write in textbox
textBox1.Text=""; //this is so that the textbox clears after the click
}
public void button2_Click(object sender, RoutedEventArgs e){
int secondbox = Convert.ToInt32(textBox1.Text); //second input!
int secondvalue = textBox.Text; //this is to store the second value that you input after buttonclick
int result = firstvalue + secondvalue; //the sum
int limitbox = Convert.ToInt32(textBox2.Text); //limit!
if (result <= limitbox) { //if you only write < and the MAX is 20, it will give you Invalid because 20 is not less than 20
textBox1.Text=result.tostring();
}else{
MessageBox.Show("Invalid input");
}
}
This is horribly written and I don't even know C#, but you can use this kind of method, you need database knowledge like asp.net or something in order to store a value properly, or maybe something else. Either way I don't see the point of doing something that's way too hard while you barely know the basics, do simpler tasks instead of going for what looks easy but that you have no idea what functions are required.
But for this program to work you need to make a button for Button1_Click that says "Add" or something, then another one for Button2_Click that says "Result" or something.