4. 1
command1
Private Sub Command1_Click()
MsgBox "this is the first msgebox", vbOKCancel,
"msgbox1“
MsgBox "this is the second msgebox", 64, "msgbox1“
MsgBox "this is the third msgebox", 5, "msgbox1“
MsgBox "this is the last msgebox", 3, "msgbox1“
End Sub
4
5. 2
Private Sub Command1_Click()
msg = vbYesNo + vbQuestion
MsgBox "are you sure", msg, "exit"
End Sub
Private Sub Command1_Click()
msg = 36
MsgBox "are you sure", msg, "exit"
End Sub
5
6. 3
Private Sub Command1_Click()
msg = 36
box = MsgBox("click yes to exit", msg, "exit")
If box = 6 Then End
End Sub
Private Sub Command2_Click()
msg = 35
box = MsgBox(“do you want to clear", msg, "clear")
If box = 6 Then Text1.Text = ""
End Sub
6
8. 4
Private Sub Command1_Click()
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then
MsgBox "no file is selected"
Else
List1.AddItem(CommonDialog1.FileName)
End If
End Sub
Private Sub Command2_Click()
List1.Clear
End Sub
8
10. 5
Private Sub Command1_Click()
msg = 67
x = MsgBox("do you want to save this file", msg, "save as")
If x = 6 Then
CommonDialog1.ShowSave
Else
End
End If
End Sub
10