Guy's,
I'm trying to insert a value into a textbox if the value in my sumTextbox is above £250.
Example I have a two textboxes one just called textbox1 and one called sumtextbox, when I run a function (button click) I would like to check the value in sumtextbox and if it's above £250 it inserts a value in textbox1 of "YES"
Is that possible with a button click?
Insert text in textbox on sum output
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Mar 21, 2014, 1:43 AM EDT
decimal d;
decimal.TryParse(sumtextbox.Text, out d);
if (d > 250m) textbox1.Text = "YES";
mike DelvottiRank #7,298 · 244 reputationPosted Mar 21, 2014, 2:03 AM EDT
I never would imagine it would only take 3 lines of code :-)
VulpesRank #55 · 29.2K reputationPosted Mar 21, 2014, 2:25 AM EDT
In this example, if the sumtextbox had been empty or contained something other than a number, then there would be no exception and 'd' would harmlessly be set to zero.
As this is under 250, the code would do nothing :)