งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

สรุปการใช้งานโปรแกรม Visual C# 2010. บวก (+) – ลบ (-) – คูณ (*) – หาร (/) int n1, n2, n3; // ประกาศค่าตัวแปรเป็นตัวเลข จำนวนเต็ม n1 = int.Parse(textBox1.Text);

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "สรุปการใช้งานโปรแกรม Visual C# 2010. บวก (+) – ลบ (-) – คูณ (*) – หาร (/) int n1, n2, n3; // ประกาศค่าตัวแปรเป็นตัวเลข จำนวนเต็ม n1 = int.Parse(textBox1.Text);"— ใบสำเนางานนำเสนอ:

1 สรุปการใช้งานโปรแกรม Visual C# 2010

2 บวก (+) – ลบ (-) – คูณ (*) – หาร (/) int n1, n2, n3; // ประกาศค่าตัวแปรเป็นตัวเลข จำนวนเต็ม n1 = int.Parse(textBox1.Text); // แปลงค่า textBox1 ให้เป็นตัวเลขจำนวนเต็ม n2 = int.Parse(textBox2.Text); // แปลงค่า textBox2 ให้เป็นตัวเลขจำนวนเต็ม n3 = n1 + n2; // คำนวณหาผลรวม n1+n2 เก็บ ผลลัพธ์ไว้ที่ N3 textBox3.Text = n3.ToString("#,###,###,###.##"); // แปลง ค่าตัวแปร n3 ซึ่งเป็นตัวเลขให้เป็นข้อความแล้ว แสดงผลที่ textBox3.Text ตามรูปแบบที่กำหนด double x; // ประกาศค่าตัวแปรเป็นตัวเลขจำนวน ทศนิยม หมายเหตุ x = double.Parse(textBox4.Text); // แปลงค่า textBox4 ให้เป็นตัวเลขจำนวนเต็ม หมายเหตุ ตัวเลขทศนิยมใช้ double หรือ float ก็ได้

3 การแสดงผล textBox1.Text = n3.ToString(); // แปลงค่าตัว แปร total ซึ่งเป็นตัวเลขให้เป็นข้อความแล้ว แสดงผลที่ textBox1 textBox2.Text = “Hello” ;// แสดงผลข้อความ “Hello” ณ ตำแหน่ง textBox2 label3.Text = “ สวัสดี ” ;// แสดงผลข้อความ “ สวัสดี ” ณ ตำแหน่ง label3 MessageBox.Show(“ หมดเวลา ”); // แสดงผล ข้อความ “ หมดเวลา ” รูปแบบ MessageBox MessageBox.Show(" พื้นที่สามเหลี่ยม "+Area.ToString()); // แสดงผลข้อความ “ พื้นที่ สามเหลี่ยมตามด้วยตัวแปร Area ซึ่งเป็นผลลัพธ์ของ พื้นที่ รูปแบบ MessageBox

4 เลือกดูรูปภาพ radioBut ton1- radioBut ton5 picture Box1 กำหนด Code ที่ตัวเลือก 1- 5 ดังนี้ ภาพที่ 1 pictureBox1.Image= new Bitmap (@"pu1.gif"); ภาพที่ 2 pictureBox1.Image= new Bitmap (@"pu2.gif"); ภาพที่ 3 pictureBox1.Image= new Bitmap (@"pu3.gif"); ภาพที่ 4 pictureBox1.Image= new Bitmap (@"dek.jpg"); ภาพที่ 5 pictureBox1.Image= new Bitmap (@"thai.png"); หมายเหตุ หมายเหตุ ภาพต้องอยู่ในโฟลเดอร์ Bin/Debug

5 แสดงรูปภาพอย่างมีเงื่อนไข ( อายุเป็น เพียงตัวเลข )

6 CODE แสดงรูปภาพอย่างมีเงื่อนไข ( อายุเป็นเพียงตัวเลข )

7 ผลลัพธ์การแสดงรูปภาพอย่างมีเงื่อนไข ( อายุเป็นเพียงตัวเลข )

8 การสุ่มตัวเลข (Random)

9 การเชื่อมโยง Form

10 Code การเชื่อมโยง Form การ เชื่อมโยง ไปยัง Form2

11 การส่งค่าข้าม Form จากตัวอย่างจะมี ทั้งหมด 4 Form Form1 Form2 Form3Form4

12 Code ส่งค่าข้าม Form ที่ Form1

13 Code ส่งค่าข้าม Form ที่ Form2

14 Code ส่งค่าข้าม Form ที่ Form4

15 Code ส่งค่าข้าม Form ที่ Form3

16 ตัวอย่างการส่งค่าข้าม Form พร้อมกัน หลายค่า Form4 f4 = new Form4(this.label1.Text, this.label2.Text, this.label3.Text, this.label4.Text, this.label5.Text, this.label6.Text); Code ขั้นตอน การส่งค่า Code ขั้นตอน การรับค่า public Form4(string data1,string data2,string data3,string data4,string data5,string data6) { InitializeComponent(); label1.Text = data1; label2.Text = data2; label3.Text = data3; label4.Text = data4; label5.Text = data5; label6.Text = data6; }

17 Timer - จับเวลา Button1 HScorllBar ProgressBar Timer

18 Code Timer - จับเวลา ขั้นตอนที่ 1 กำหนด Code ปุ่ม Timer ขั้นตอนที่ 2 กำหนด Code ปุ่ม จับเวลา

19 Code Timer - จับเวลา การประยุกต์ใช้งานแสดงข้อความ Message Box เมื่อหมดเวลา และเชื่อมโยงไป Form2 progressBar1.Value += 10; hScrollBar1.Value += 10; if (progressBar1.Value == progressBar1.Maximum) { timer1.Enabled = false; button1.Enabled = false; MessageBox.Show(" Time Out "); Form2 f2 = new Form2(); f2.Show(); this.Hide(); }


ดาวน์โหลด ppt สรุปการใช้งานโปรแกรม Visual C# 2010. บวก (+) – ลบ (-) – คูณ (*) – หาร (/) int n1, n2, n3; // ประกาศค่าตัวแปรเป็นตัวเลข จำนวนเต็ม n1 = int.Parse(textBox1.Text);

งานนำเสนอที่คล้ายกัน


Ads by Google