Hi, new to the CG boards. Just got back into coding after awhile of not and need some help on a calculator app I am building for the coding practice. I have most of the buttons working, except the operator buttons (add, subtract etc..) do not calculate. The calculate() function I coded isnt getting the otherValue with the getOtherValue() I coded and i cannot figure out why. I get an exception error that says the input string isnt in the correct format. Below is my code, all help is appreciated :) if you wish to download the full project i have attached it as a zip.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Calculator
{
public partial class MainWindow : Window
{
Operation operation;
String buttonContent;
double currentValue;
double otherValue;
double finalValue;
public enum Operation
{
Addition,
Subtraction,
Multiplication,
Division
}
When you put a breakpoint in the button handlers, does the breakpoint get hit when you click the button?
If not, in the form design view, highlight the button, right click and choose properties. In the properties window, click on the lightning bolt icon (it switches to the event view), check to see if the OnClick handler has been set.