0

I want the user to be able to type like = or whatever and then write an equation. Once they click off the box, I want the textbox to show the answer.

For example they could put =2+2 and it would display 4 when not selected.

I have no idea how to do this at all or even where to begin. I can get the textbox to calculate it somewhere else but not in the box itself where the equation is written or without having the user press a button.

sharknado
  • 7
  • 1

1 Answers1

2

What you're probably looking for is the LostFocus event. This event fires whenever a control loses focus (for example when a user tabs out of a text box). If you listen on this event for your text box, you can then call whatever processing code you want to handle any calculations required by the value of the text box and then set its value to the result of the calculation.

Chris Charabaruk
  • 4,367
  • 2
  • 30
  • 57