akjf.txt (5.64K)
Number of downloads: 22
akjf.txt (5.64K)
Number of downloads: 22Now I click on Bin radio button remaining numbers are hide only 0 and 1 should be work in operations and click on hex, hex values work in operations like in windows 7 programmer calci
private System.Windows.Forms.TextBox calci;
private System.Windows.Forms.Button btnD;
private System.Windows.Forms.Button btnE;
private System.Windows.Forms.Button btnF;
private System.Windows.Forms.Button btnA;
private System.Windows.Forms.Button btnB;
private System.Windows.Forms.Button btnC;
private System.Windows.Forms.Button btn1;
private System.Windows.Forms.Button btn2;
private System.Windows.Forms.Button btn3;
private System.Windows.Forms.Button btn4;
private System.Windows.Forms.Button btn5;
private System.Windows.Forms.Button btn6;
private System.Windows.Forms.Button btn7;
private System.Windows.Forms.Button btn9;
private System.Windows.Forms.Button btndot;
private System.Windows.Forms.Button btn0;
private System.Windows.Forms.Button btneql;
private System.Windows.Forms.Button btnclr;
private System.Windows.Forms.Button btn8;
private System.Windows.Forms.Button btnsub;
private System.Windows.Forms.Button btnmul;
private System.Windows.Forms.Button btnadd;
private System.Windows.Forms.Button btndiv;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.Button btnbsp;
bool plus = false;
bool minus = false;
bool multiply = false;
bool divide = false;
private void btn1_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "1";
}
private void btn2_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "2";
}
private void btn3_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "3";
}
private void btn4_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "4";
}
private void btn5_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "5";
}
private void btn6_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "6";
}
private void btn7_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "7";
}
private void btn8_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "8";
}
private void btn9_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "9";
}
private void btn0_Click(object sender, EventArgs e)
{
calci.Text = calci.Text + "0";
}
private void btndot_Click(object sender, EventArgs e)
{
if (calci.Text.Contains("."))
{
return;
}
else
{
calci.Text = calci.Text + ".";
}
}
private void btndiv_Click(object sender, EventArgs e)
{
if (calci.Text == "")
{
return;
}
else
{
divide = true;
calci.Tag = calci.Text;
calci.Text = "";
}
}
private void btnmul_Click(object sender, EventArgs e)
{
if (calci.Text == "")
{
return;
}
else
{
multiply = true;
calci.Tag = calci.Text;
calci.Text = "";
}
}
private void btnsub_Click(object sender, EventArgs e)
{
if (calci.Text == "")
{
return;
}
else
{
minus = true;
calci.Tag = calci.Text;
calci.Text = "";
}
}
private void btnadd_Click(object sender, EventArgs e)
{
if (calci.Text == "")
{
return;
}
else
{
plus = true;
calci.Tag = calci.Text;
calci.Text = "";
}
}
private void btneql_Click(object sender, EventArgs e)
{
if (plus)
{
decimal dec = Convert.ToDecimal(calci.Tag) + Convert.ToDecimal(calci.Text);
calci.Text = dec.ToString();
}
else if (minus)
{
decimal dec = Convert.ToDecimal(calci.Tag) - Convert.ToDecimal(calci.Text);
calci.Text = dec.ToString();
}
else if (multiply)
{
decimal dec = Convert.ToDecimal(calci.Tag) * Convert.ToDecimal(calci.Text);
calci.Text = dec.ToString();
}
else if (divide)
{
decimal dec = Convert.ToDecimal(calci.Tag) / Convert.ToDecimal(calci.Text);
calci.Text = dec.ToString();
}
return;
}
private void btnclr_Click(object sender, EventArgs e)
{
calci.Text = "";
}
private void btnbsp_Click(object sender, EventArgs e)
{
if (calci.Text.Length > 0)
calci.Text = calci.Text.Remove(calci.Text.Length - 1);
}
MOD EDIT: Moved code into post. Don't make people download text files; put your code IN your post.
This post has been edited by JackOfAllTrades: 29 September 2012 - 03:52 AM

New Topic/Question
Reply



MultiQuote





|