NaN means "Not a Number"

The first thing that leaps out from your code is you are doing mathematical operations on textboxes.

You should convert 2nd.text, 3rd.text into numbers - either singles, doubles or integers depending on what you expect.