CNSA-212-Personal/ElementaryMathematics/Form1.cs

101 lines
2.5 KiB
C#
Raw Normal View History

2024-02-01 09:26:21 -05:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics.Eventing.Reader;
2024-02-01 09:26:21 -05:00
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ElementaryMathematics
{
public partial class Form1 : Form
{
private bool isAdd = false;
private bool isSubtract = false;
private bool isMultiply = false;
private bool isDivide = false;
2024-02-01 09:26:21 -05:00
public Form1()
{
InitializeComponent();
2024-02-01 09:33:17 -05:00
//test
2024-02-01 09:26:21 -05:00
}
2024-02-01 09:56:22 -05:00
private void groupBox1_Enter(object sender, EventArgs e)
{
// throw new System.NotImplementedException();
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
// throw new System.NotImplementedException();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
// throw new System.NotImplementedException();
}
2024-02-01 09:57:29 -05:00
private void button1_Click(object sender, EventArgs e)
{
// throw new System.NotImplementedException();
}
private void ChangeOperator(string op)
{
isAdd = false;
isSubtract = false;
isMultiply = false;
isDivide = false;
if (op == "+")
{
isAdd = true;
lblOperator.Text = op;
}else if (op == "-")
{
isSubtract = true;
lblOperator.Text = op;
}else if (op == "*")
{
isMultiply = true;
lblOperator.Text = op;
}else if (op == "/")
{
isDivide = true;
lblOperator.Text = op;
}
else
{
lblOperator.Text = "";
}
}
private void rdoAddition_CheckedChanged(object sender, EventArgs e)
{
ChangeOperator("+");
}
private void rdoSubtraction_CheckedChanged(object sender, EventArgs e)
{
ChangeOperator("-");
}
private void rdoMultiplication_CheckedChanged(object sender, EventArgs e)
{
ChangeOperator("*");
}
private void rdoDivision_CheckedChanged(object sender, EventArgs e)
{
ChangeOperator("/");
}
2024-02-01 09:26:21 -05:00
}
}