ماشین حساب

Ronin87

عضو جدید
سلام و با عرض تبریک سال نو
من یه ماشین حساب ساده نوشتم که میخواستم گزینه های M+ و MR,MS,MC را به اون اضافه کنم
ممنون میشم اگه کسی میتونه کمکم کنه
با تشکر
 

A.S.Roma

عضو جدید
کاربر ممتاز
نمی دونم ساختار برنامتون رو چطوری نوشتید .
با این حال ... .

یک فیلد به کلاستون اضافه کنید به اسم مثلا"‌memory
در ایونت کلیک دکمه های بالا ازش استفاده کنید .
مثلا" MS میشه :
کد:
memory = float.parse(usrTextBoxName.Text);

پ.ن : البته اگه MS قرار باشه کار دیگه نکنه !:warn:
 

_METI_

عضو جدید
کمک در رابطه با ماشین حساب

کمک در رابطه با ماشین حساب

با درود
من یه ماشین حساب به زبان سی شارپ دارم و مشکلش اینه که مثل ماشین حساب در ویندوز نمی تونه در آن واحد چند عدد رو محاسبه کنه مثل 1+2+5
از بزرگان درخواست کمک دارم
مشاهده پیوست machin hesab.rar
 
آخرین ویرایش:

flash118

عضو جدید
دوست عزیز میشه منظورتون واضح برسونی یعنی چی تو ویندوز نمی تونه ؟؟؟
 

senaps

عضو جدید
کاربر ممتاز
ماشین حساب ویندوز 7،ابتدا یه مجموعه رو میگیره!!
مثلا 5+2+3+4+8+9 و بعد که دگمه ی = رو بزنی،نتیجه ی نهایی رو میده!!!
در صورتی که در حالت عادی،اینجوری میشه:
5+2
7+3
10+4
14+8
.....
اره!!
حالا برای رفع این مشکل،نمیدونم باید چیکار کنید!!راستش برای پروژه ی ماشین حساب خودم هم میخوام این کارو بکنم!! ولی فعلا ایده ای ندارم!! البته یه راه حلاینه که یه تابع بسازین، که هر بار که + رو میزنین،عدد قبلش رو به تابع بفرسته و با مقدار قبلی جمع کنه!!و در نهایت،بعد از زدن =،نتیجه ی نهایی،اخرین ریترن تابع باشه!! حالا سعی میکنم برا خودم که ساختمش! کدش رو به شما هم بدم.....
 

flash118

عضو جدید
دوست عزیز حالا گرفتم
ببنید شما می تونید در راه اول از آرایه استفاده کنید که هر عدد ورودی رو در یه خانه آرایه قرار بدید و یا در روش دوم عدد ورودی رو به صورت جمع تو تکس باکس چاپ کنید مثل (5+2+3+4+8+9 ) و بعد از همین تکس یکی یکی جدا کنید جمع کنید و جواب نهایی رو بدید دقت کنید تو هر دو روش باید خاصیت مالتی لین تکس باکس فعال باشه موفق باشید
 

baharan20

عضو جدید
سلام
این کدی هستش که من نوشتم امیدوارم به دردت بخوره
البته من خودم مبتدی هستم:) ولی این درست کار میکنه
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int total;
int total1;
bool button10_click=false;
bool button12_click=false;
bool button11_click = false;
bool button13_click = false;
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text =textBox1.Text+button1.Text ;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button2.Text;
}

private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button3.Text;
}

private void button4_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button4.Text;

}

private void button5_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button5.Text;
}

private void button6_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button6.Text;

}

private void button7_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button7.Text;
}

private void button8_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button8.Text;
}

private void button9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text+button9.Text;
}

private void button15_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + button15.Text;
}

private void button16_Click(object sender, EventArgs e)
{
textBox1.Clear();
}

private void button10_Click(object sender, EventArgs e)
{


if (button12_click == true)
{
total1 = total - Convert.ToInt32(textBox1.Text);
textBox1.Text= total1.ToString();
total = 0;
}

if (button10_click == true)
{
total1 = total + Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if (button11_click == true)
{
total1 = total * Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if (button13_click == true)
{
total1 = total / Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
total = total + Convert.ToInt32(textBox1.Text);
textBox1.Clear();
button12_click = false;
button10_click= true;
button11_click = false;
button13_click= false;
}

private void button14_Click(object sender, EventArgs e)
{
if (button10_click==true)
{
total1 = total + Convert.ToInt32(textBox1.Text);

}

if (button12_click==true)
{
total1 = total - Convert.ToInt32(textBox1.Text);


}
if (button11_click == true)
{
total1 = total * Convert.ToInt32(textBox1.Text);


}
if (button13_click == true)
{
total1 = total / Convert.ToInt32(textBox1.Text);


}
textBox1.Text = total1.ToString();
total = 0;
button12_click = false;
button10_click = false;
button11_click = false;
button13_click = false;

}

private void button12_Click(object sender, EventArgs e)
{

if (button10_click == true)
{
total1 = total + Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if (button11_click == true)
{
total1 = total * Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}

if (button12_click == true)
{
total1 = total - Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;
}
if (button13_click == true)
{
total1 = total / Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
total = total+Convert.ToInt32(textBox1.Text);
textBox1.Clear();
button12_click = true;
button10_click = false;
button11_click = false;
button13_click= false;

}

private void button11_Click(object sender, EventArgs e)
{
if (button10_click == true)
{
total1 = total + Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if (button11_click == true)
{
total1 = total * Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if (button12_click == true)
{
total1 = total - Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;
}
if (button13_click == true)
{
total1 = total / Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
total = total + Convert.ToInt32(textBox1.Text);
textBox1.Clear();
button12_click = false;
button10_click = false;
button11_click = true;
button13_click = false;

}

private void button13_Click(object sender, EventArgs e)
{
if (button11_click == true)
{
total1 = total * Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if(button13_click==true)
{
total1 = total / Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if(button12_click==true)
{
total1 = total - Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
if(button11_click=true)
{
total1 = total + Convert.ToInt32(textBox1.Text);
textBox1.Text = total1.ToString();
total = 0;

}
total = total + Convert.ToInt32(textBox1.Text);
textBox1.Clear();
button12_click = false;
button10_click = false;
button11_click = false;
button13_click= true;

}

















}
}
 

mohandes eli

عضو جدید
برنامه ماشین حساب ساده با C#

برنامه ماشین حساب ساده با C#

سلام.لطفا سورس ی ماشین حساب ساده رو فورا اگه کسی داره بهم بده:(
 

ali 006

عضو جدید
ماشین حساب

سلام
برنامه ماشین حساب گویا بازبان C#.NETاحتیاج دارم .هر چه زودتر بهتر
 
بالا