|
-
June 19th, 2009, 08:06 AM
#1
Whats wrong with my code? Can someone help me plz?
Im using microsoft visual studio and im making a calculator for a project but Im missing somethings. Can someone review and help me in detail?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace calculator2
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D1.Text;
}
protected void D2_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D2.Text;
}
protected void D3_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D3.Text;
}
protected void D4_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D4.Text;
}
protected void D5_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D5.Text;
}
protected void D6_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D6.Text;
}
protected void Button7_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D7.Text;
}
protected void D8_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D8.Text;
}
protected void Button9_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D9.Text;
}
protected void Bminus_Click(object sender, EventArgs e)
{
string fnum = TextBox1.Text;
TextBox1.Text = "";
string operation = "subtraction";
}
protected void D0_Click(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.Text + D0.Text;
}
protected void Button12_Click(object sender, EventArgs e)
{
string fnum = TextBox1.Text;
TextBox1.Text = "";
string operation = "addition";
}
protected void Bmult_Click(object sender, EventArgs e)
{
string fnum = TextBox1.Text;
TextBox1.Text = "";
string operation = "multiply";
}
protected void Bclear_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
}
protected void Benter_Click(object sender, EventArgs e)
{
string anum = TextBox1.Text;
int Benter = Convert.ToInt16(anum);
int snum = Convert.ToInt16(fnum);
}
}
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|