1 / 11

Lab 7

Lab 7. Intro VB. ฝึกใช้ Label, TextBox, Command Button, MsgBox. Form. Label. TextBox. Command Button. ฝึกใช้ Label, TextBox, Command Button, MsgBox. ฝึกใช้ Label, TextBox, Command Button, MsgBox. Private Sub cmdShow _Click ()

Télécharger la présentation

Lab 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 7 Intro VB

  2. ฝึกใช้ Label, TextBox, Command Button, MsgBox Form Label TextBox Command Button

  3. ฝึกใช้ Label, TextBox, Command Button, MsgBox

  4. ฝึกใช้ Label, TextBox, Command Button, MsgBox Private Sub cmdShow_Click() MsgBoxtxtName.Text& " is " &txtAge.Text & " years olds.",vbExclamation, "Detail" End Sub

  5. ฝึกใช้ Label, TextBox, Command Button, MsgBox Private Sub cmdShow_Click() MsgBoxtxtName.Text & " is " & txtAge.Text & " years olds.",vbExclamation, "Detail" End Sub

  6. ฝึกใช้ Label, TextBox, Command Button, MsgBox Private Sub cmdEnd_Click() End End Sub

  7. ข้อ 1.3 สร้าง GUI สำหรับการ Login ของผู้ใช้ดังรูป

  8. 1.4 เมื่อผู้ใช้คลิ๊ก “OK” ให้แสดงข้อความดังตัวอย่าง Private Sub cmdOK_Click() MsgBox“Password incorrect. Please try again.",vbExclamation, “Warning" End Sub

  9. 1.5เมื่อผู้ใช้คลิ๊ก “Cancel” ให้ลบข้อมูลที่อยู่ใน text box ออกให้หมด Private Sub cmdCancel_Click() txtUserName.Text = “” txtPassword.Text = “” End Sub

  10. การใช้ MsgBox • รูปแบบ MsgBoxPrompt[,Buttons + Sign] [,Title] MsgBoxชื่อคำสั่ง Prompt ข้อความที่ให้แสดงบน Message Box [,Buttons + Sign] ปุ่มและสัญลักษณ์ [,Title] ชื่อเรื่อง

  11. การใช้ MsgBox • Buttons (ปุ่ม) เช่น • vbOKOnly • vbOKCancel • vbYesNo • Signs (สัญลักษณ์) • vbCritical • vbExclamation • vbInformation • vbQuestion • ตัวอย่าง • MsgBox“Can you speak Thai?” ,vbYesNo + vbQuestion,“Question"

More Related