โปรแกรมคำนวณการขายสินค้า

โปรแกรมคำนวณรายการขาย

หน้าจอออกแบบ

หน้าจอ

คำสั่ง

ปุ่มคำนวณ

private void button1_Click(object sender, EventArgs e)

{

int num1,num2,sell;

num1 = Convert.ToInt32(textBox1.Text);

num2 = (num1 * 3) / 100;

sell = (num1 – num2);

label3.Text =(num2.ToString());

textBox2.Text =(sell.ToString());

}

ปุ่มยกเลิก

private void button2_Click(object sender, EventArgs e)

{

textBox1.Text = “”;

label3.Text = “”;

textBox2.Text = “”;

}

 

ปุ่มออกจากโปรแกรม

private void button3_Click(object sender, EventArgs e)

{

Close();

}

 

ผลการรันโปรแกรม

ผลลัพธ์

Posted on กันยายน 15, 2014, in ภาษา C. Bookmark the permalink. ใส่ความเห็น.

ใส่ความเห็น

This site uses Akismet to reduce spam. Learn how your comment data is processed.