SlideShare a Scribd company logo
1 of 8
บทที่ 9 คอนโทรล Option button
คอนโทรล Checkbox
Checkbox จะมีลักษณะเดียวกันกับ Option Button แต่จะแตกต่างกันตรงที่
Checkbox สามารถที่จะเลือกได้หลายช่องทาง
การใช้งาน Checkbox
1.สร้างฟอร์มและนาคอนโทรล “Label” จานวน 4 คอนโทรล คอนโทรล
“Textbox” จานวน 1 คอนโทรล คอนโทรล “Option Button” จานวน 2 คอนโทรล และ
คอนโทรล “Checkbox”จานวน 4 คอนโทรลวาดลงบนฟอร์ม
2.ทาการ Run โดยกด F5
คอนโทรล Frame
คอนโทรล Frame เป็น Control ที่ใช้สาหรับจัดกลุ่มคอนโทรลที่ต้องใช้ร่วมกันเป็นกลุ่ม
เช่น ใช้ในการจัดกลุ่ม Checkbox บนฟอร์มออกเป็นกลุ่มๆ เป็นต้น ซึ่งโดยทั่วไปแล้วคอนโทรล
เฟรมจะใช้ตกแต่งหรือจัด Control อื่นๆ ให้เป็ระเบียบน่าดูยิ่งขึ้น
การใช้งาน Frame
1.เปิด Form ของตัวอย่างที่แล้ว
2.ให้คลิกเลือกรายวิชาทั้งหมด โดยการกดปุ่ม Ctrl ค้างไว้และคลิกเลือกรายวิชาจนครบ
3.ให้คลิกเลือกคาสั่งCut เพื่อเก็บข้อมูลไว้หน่วยความจาชั่วคราวหรือคลิบบอร์ด
4.ให้วาด Control “Frame” ลงในฟอร์มของตัวอย่างที่แล้ว
5.คลิกเลือก Control Frame และเลือกคาสั่ง Paste
6.จัดตาแหน่งของ Checkbox ให้อยู่ในตาแหน่งที่เหมาะสม
7.ลบ Label 3 (รายวิชาที่ลงทะเบียน) และให้กาหนดคุณสมบัติของ Frame ในส่วนของ
Caption เป็นรายวิชาที่ลงทะเบียน
คอนโทรล List Box
List Box เป็น Control ที่มีลักษณะที่คล้ายกับOption Button เช่นกัน แต่ว่า List
Box นั้นจะมีทางเลือกได้มากกว่าเนื่องจากว่ามีความสามารถเพิ่มเติมทางเลือกได้มากกว่า
หนึ่งทาง
การใช้ List Box
1.ให้ทาการสร้าง Form ขึ้นมาใหม่ แล้วทาการวาดList Box ลงใน Form2.กาหนด
คุณสมบัติให้กับ Control ดังนี้
2.กาหนดคุณสมบัติให้กับ Control ดังนี้
2.1 Control List1 ด้วยการคลิกเลือก Control List1 และเลือกคุณสมบัติ ดังนี้
- การกาหนด Property “List” เพิ่มข้อมูลรายการโดยคลิกที่ปุ่ม เพิ่มข้อความ
“วันอาทิตย์” แล้วกด Enter เราก็จะได้ข้อความ “วันอาทิตย์”หนึ่งรายการ และย้อนกลับไป
คลิกที่ปุ่ม เพิ่มข้อความ “วันจันทร์” แล้วกด Enter ทาไปเรื่อยๆ จนครบทุกรายการ
จะได้ผลลัพธ์ดังรูป
2.2 Control List 2 ด้วยการคลิกเลือก Control List 2 และเลือกคุณสมบัติดังนี้
- การกาหนดProperty “List” เพิ่มข้อมูลรายการโดยคลิกที่ปุ่ม เพิ่ม
ข้อความ “เล่นกีฬา” แล้วกด Enter เราก็จะได้ข้อความ “วันอาทิตย์” หนึ่งรายการ และ
ย้อนกลับไปคลิกที่ปุ่ม เพิ่มข้อความ “อ่านหนังสือ” แล้วกด Enter ทาไปเรื่อยๆ จนครบทุก
รายการ
- กาหนด Properties “Style”เป็น Check Box
- กาหนด Properties “MultiSelect”เป็น Simple
- กาหนด Properties“Columnst” เป็น 2
จะได้ผลลัพธ์ดังรูป
คอนโทรล Combo Box
Combo Box เป็น Control ที่รวมเอาความสามารถของ TextBox และ ListBox ไว้
ด้วยกัน คือ นอกจากจะคลิกเลือกรายการที่มีอยู่แล้ว ยังสามารถพิมพ์รายการข้อมูลที่
ต้องการเข้าไปใหม่ได้
การใช้งาน Combo Box
1.ให้ทาการสร้าง Form ขึ้นมาใหม่ แล้วทาการวาดCombo Box ลงใน Form ดังรูป
2.กาหนดคุณสมบัติให้กับControl ดังนี้
2.1Control Combo 1 ด้วยการคลิกเลือก Control Combo 1 แล้วเลือกคุณสมบัติ ดังนี้
- การกาหนด Property “List” เพิ่มข้อมูลรายการโดยคลิกที่ปุ่ม เพิ่มข้อความ
“ปวช.”แล้วกดEnter เราก็จะได้ข้อความ “ปวช.” หนึ่งรายการ และย้อนกลับไปคลิกที่ปุ่ม
เพิ่มข้อความ “ปวส.” แล้วกด Enter ทาไปเรื่อยๆ จนครบทุกรายการ จะได้ผลลัพธ์
ดังรูป
จากผลการรันโปรแกรมจะสังเกตุเห็นว่า Combo1 สามารถป้อนข้อมูลที่ต้องการเข้า
ไปเองหรือคลิกเลือกรายการข้อมูลก็ได้ส่วน Combo2 จะเลือกรายการข้อมูลด้วยการป้อน
หรือพิมพ์ข้อความเข้าไปเท่านั้น และ Combo3 สามารถที่จะเลือกรายการข้อมูลที่มีใน List
เพียงอย่างเดียวเท่านั้น

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Powerpoint บทที่ 9

  • 1. บทที่ 9 คอนโทรล Option button คอนโทรล Checkbox Checkbox จะมีลักษณะเดียวกันกับ Option Button แต่จะแตกต่างกันตรงที่ Checkbox สามารถที่จะเลือกได้หลายช่องทาง การใช้งาน Checkbox 1.สร้างฟอร์มและนาคอนโทรล “Label” จานวน 4 คอนโทรล คอนโทรล “Textbox” จานวน 1 คอนโทรล คอนโทรล “Option Button” จานวน 2 คอนโทรล และ คอนโทรล “Checkbox”จานวน 4 คอนโทรลวาดลงบนฟอร์ม 2.ทาการ Run โดยกด F5
  • 2. คอนโทรล Frame คอนโทรล Frame เป็น Control ที่ใช้สาหรับจัดกลุ่มคอนโทรลที่ต้องใช้ร่วมกันเป็นกลุ่ม เช่น ใช้ในการจัดกลุ่ม Checkbox บนฟอร์มออกเป็นกลุ่มๆ เป็นต้น ซึ่งโดยทั่วไปแล้วคอนโทรล เฟรมจะใช้ตกแต่งหรือจัด Control อื่นๆ ให้เป็ระเบียบน่าดูยิ่งขึ้น การใช้งาน Frame 1.เปิด Form ของตัวอย่างที่แล้ว 2.ให้คลิกเลือกรายวิชาทั้งหมด โดยการกดปุ่ม Ctrl ค้างไว้และคลิกเลือกรายวิชาจนครบ 3.ให้คลิกเลือกคาสั่งCut เพื่อเก็บข้อมูลไว้หน่วยความจาชั่วคราวหรือคลิบบอร์ด 4.ให้วาด Control “Frame” ลงในฟอร์มของตัวอย่างที่แล้ว 5.คลิกเลือก Control Frame และเลือกคาสั่ง Paste 6.จัดตาแหน่งของ Checkbox ให้อยู่ในตาแหน่งที่เหมาะสม 7.ลบ Label 3 (รายวิชาที่ลงทะเบียน) และให้กาหนดคุณสมบัติของ Frame ในส่วนของ Caption เป็นรายวิชาที่ลงทะเบียน
  • 3. คอนโทรล List Box List Box เป็น Control ที่มีลักษณะที่คล้ายกับOption Button เช่นกัน แต่ว่า List Box นั้นจะมีทางเลือกได้มากกว่าเนื่องจากว่ามีความสามารถเพิ่มเติมทางเลือกได้มากกว่า หนึ่งทาง การใช้ List Box 1.ให้ทาการสร้าง Form ขึ้นมาใหม่ แล้วทาการวาดList Box ลงใน Form2.กาหนด คุณสมบัติให้กับ Control ดังนี้ 2.กาหนดคุณสมบัติให้กับ Control ดังนี้ 2.1 Control List1 ด้วยการคลิกเลือก Control List1 และเลือกคุณสมบัติ ดังนี้
  • 4. - การกาหนด Property “List” เพิ่มข้อมูลรายการโดยคลิกที่ปุ่ม เพิ่มข้อความ “วันอาทิตย์” แล้วกด Enter เราก็จะได้ข้อความ “วันอาทิตย์”หนึ่งรายการ และย้อนกลับไป คลิกที่ปุ่ม เพิ่มข้อความ “วันจันทร์” แล้วกด Enter ทาไปเรื่อยๆ จนครบทุกรายการ จะได้ผลลัพธ์ดังรูป
  • 5. 2.2 Control List 2 ด้วยการคลิกเลือก Control List 2 และเลือกคุณสมบัติดังนี้ - การกาหนดProperty “List” เพิ่มข้อมูลรายการโดยคลิกที่ปุ่ม เพิ่ม ข้อความ “เล่นกีฬา” แล้วกด Enter เราก็จะได้ข้อความ “วันอาทิตย์” หนึ่งรายการ และ ย้อนกลับไปคลิกที่ปุ่ม เพิ่มข้อความ “อ่านหนังสือ” แล้วกด Enter ทาไปเรื่อยๆ จนครบทุก รายการ - กาหนด Properties “Style”เป็น Check Box - กาหนด Properties “MultiSelect”เป็น Simple - กาหนด Properties“Columnst” เป็น 2 จะได้ผลลัพธ์ดังรูป
  • 6. คอนโทรล Combo Box Combo Box เป็น Control ที่รวมเอาความสามารถของ TextBox และ ListBox ไว้ ด้วยกัน คือ นอกจากจะคลิกเลือกรายการที่มีอยู่แล้ว ยังสามารถพิมพ์รายการข้อมูลที่ ต้องการเข้าไปใหม่ได้ การใช้งาน Combo Box 1.ให้ทาการสร้าง Form ขึ้นมาใหม่ แล้วทาการวาดCombo Box ลงใน Form ดังรูป
  • 7. 2.กาหนดคุณสมบัติให้กับControl ดังนี้ 2.1Control Combo 1 ด้วยการคลิกเลือก Control Combo 1 แล้วเลือกคุณสมบัติ ดังนี้ - การกาหนด Property “List” เพิ่มข้อมูลรายการโดยคลิกที่ปุ่ม เพิ่มข้อความ “ปวช.”แล้วกดEnter เราก็จะได้ข้อความ “ปวช.” หนึ่งรายการ และย้อนกลับไปคลิกที่ปุ่ม เพิ่มข้อความ “ปวส.” แล้วกด Enter ทาไปเรื่อยๆ จนครบทุกรายการ จะได้ผลลัพธ์ ดังรูป
  • 8. จากผลการรันโปรแกรมจะสังเกตุเห็นว่า Combo1 สามารถป้อนข้อมูลที่ต้องการเข้า ไปเองหรือคลิกเลือกรายการข้อมูลก็ได้ส่วน Combo2 จะเลือกรายการข้อมูลด้วยการป้อน หรือพิมพ์ข้อความเข้าไปเท่านั้น และ Combo3 สามารถที่จะเลือกรายการข้อมูลที่มีใน List เพียงอย่างเดียวเท่านั้น