Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore PPTงานนำเสนอใบงานฝึกปฏิบัติ

PPTงานนำเสนอใบงานฝึกปฏิบัติ

Published by ch.aunchalee, 2020-12-03 04:08:16

Description: PPTงานนำเสนอใบงานฝึกปฏิบัติ

Search

Read the Text Version

4. ดับเบ้ลิ คลกิ ท่ี panel1 แลว้ พมิ พโ์ ค๊ตในข้อท่ี 5 หนา้ ถดั ไป ดบั เบ้ลิ คลกิ panel1 แลว้ พมิ พ์โคต๊ ยอ้ นกลบั ถดั ไป

5. โคต๊ panel1 private void panel1_Paint(object sender, PaintEventArgs e) { var graphics = e.Graphics; //Get the middle of the panel var x_0 = panel1.Width / 2; var y_0 = panel1.Height / 2; var n = (int)numericUpDown1.Value; var shape = new PointF[n]; var r = (int)numericUpDown2.Value; // px radius //Create 6 points for (int a = 0; a < n; a++) { shape[a] = new PointF( x_0 + r * (float)Math.Cos(a * (int)numericUpDown3.Value * Math.PI / 180f), y_0 + r * (float)Math.Sin(a * (int)numericUpDown3.Value * Math.PI / 180f)); } graphics.DrawPolygon(Pens.Red, shape); } ย้อนกลบั ถดั ไป

6. ดับเบล้ิ คลกิ ท่ี numericUpDown1 แลว้ พมิ พโ์ คต๊ ดังน้ี ดับเบ้ิลคลกิ numericUpDown1 โคต๊ numericUpDown1 private void numericUpDown1_ValueChanged(object sender, EventArgs e) { panel1.Refresh(); } ย้อนกลบั ถดั ไป

7. ดับเบลิ้ คลิกที่ numericUpDown2 แล้วพิมพโ์ ค๊ตดงั นี้ ดับเบล้ิ คลิก numericUpDown2 โค๊ต numericUpDown2 private void numericUpDown2_ValueChanged(object sender, EventArgs e) { panel1.Refresh(); } ย้อนกลบั ถดั ไป

8. ดบั เบ้ลิ คลิกที่ numericUpDown3 แล้วพมิ พโ์ คต๊ ดังนี้ ดบั เบล้ิ คลิก numericUpDown3 โคต๊ numericUpDown3 private void numericUpDown3_ValueChanged(object sender, EventArgs e) { panel1.Refresh(); } ย้อนกลบั ถดั ไป

9. Run โปรกรม และทดสอบโดยกาหนดตัวเลขดงั ภาพ แล้วกดปมุ่ button1 จะได้ผลลัพธด์ งั ภาพ ยอ้ นกลบั ถดั ไป

10. ทดสอบโดยกาหนดตัวเลขใหม่ ดงั ภาพ แล้วกดปุ่ม button1 จะได้ผลลพั ธ์ดงั ภาพ ยอ้ นกลบั ถดั ไป

11. ทดสอบโดยกาหนดตัวเลขใหม่ ดงั ภาพ แล้วกดปุ่ม button1 จะได้ผลลพั ธ์ดงั ภาพ ยอ้ นกลบั ถดั ไป

12. ทดสอบโดยกาหนดตัวเลขใหม่ ดงั ภาพ แลว้ กดปุ่ม button1 จะไดผ้ ลลพั ธด์ ังภาพ ยอ้ นกลบั


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook