Skip to content

Instantly share code, notes, and snippets.

@localdevm
Last active November 19, 2015 15:55
Show Gist options
  • Save localdevm/1f04a1bb6d97f99f9bd5 to your computer and use it in GitHub Desktop.
Save localdevm/1f04a1bb6d97f99f9bd5 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 Opgave7._7
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
string click = string.Empty;
string operand1 = string.Empty;
string operand2 = string.Empty;
char operation;
int resultaat = 0;
private void btnNumber(object sender, RoutedEventArgs e)
{
var button = (Button)sender;
this.click += (string)button.Content;
txbInput.Text= click;
}
private void btnPlus(object sender, RoutedEventArgs e)
{
var button = (Button)sender;
this.operation = (Convert.ToChar("+"));
}
private void btnMinus(object sender, RoutedEventArgs e)
{
var button = (Button)sender;
this.operation = (Convert.ToChar("-"));
}
private void btnEquals(object sender, RoutedEventArgs e)
{
var button = (Button)sender;
this.operation = (Convert.ToChar("="));
//if statement char
}
private void btnClear(object sender, RoutedEventArgs e)
{
click = "";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment