mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-23 02:12:14 +00:00
Added plus & equals functionality
This commit is contained in:
parent
6a50e9fdda
commit
d23d4826f0
2 changed files with 25 additions and 2 deletions
|
@ -188,6 +188,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.buttonEquals.TabIndex = 12;
|
||||
this.buttonEquals.Text = "=";
|
||||
this.buttonEquals.UseVisualStyleBackColor = true;
|
||||
this.buttonEquals.Click += new System.EventHandler(this.buttonEquals_Click);
|
||||
//
|
||||
// buttonPlus
|
||||
//
|
||||
|
|
|
@ -136,14 +136,36 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
private void buttonPlus_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (operationnumber == 0 && activeoperation != 1)
|
||||
if (operationnumber == 0 && activeoperation == 0)
|
||||
{
|
||||
operationnumber = currentnumber;
|
||||
activeoperation = 1;
|
||||
} else
|
||||
{
|
||||
|
||||
solve();
|
||||
operationnumber = currentnumber;
|
||||
activeoperation = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void solve()
|
||||
{
|
||||
switch (activeoperation)
|
||||
{
|
||||
case 1:
|
||||
numBox.Text = (currentnumber + operationnumber).ToString();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonEquals_Click(object sender, EventArgs e)
|
||||
{
|
||||
solve();
|
||||
operationnumber = 0;
|
||||
activeoperation = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue