turning a textbox into a calculator

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm trying to figure out how to take the string entered into a textbox, and
if I don't just accept the number entered, if +, -, *, / were entered, to
convert that into the correct number to be displayed in the textbox. I'm not
completely sure how to go about this.
Thanks!
Melanie
 
melanieab said:
Hi,
I'm trying to figure out how to take the string entered into a textbox, and
if I don't just accept the number entered, if +, -, *, / were entered, to
convert that into the correct number to be displayed in the textbox. I'm not
completely sure how to go about this.
Thanks!
Melanie

You can add a handler for textBox.KeyDown and analyze what key was pressed.
Then just set e.Handled = true to prevent bubbling.

BR,
Andrey
 
Back
Top