I'm trying to program a calculator in which the buttons send a character to a textbox. When the user presses the "equals" button, the whole string must be calculated and the answer must be displayed as a decimal. Obviously the following doesn't work:
private void btn_enter_Click(object sender, EventArgs e)
{
decimal answer;
answer = Convert.ToDecimal(textBox1.Text);
textBox1.Text += "=" + answer;
}
What is the best way to make something like this works?