Private Sub cmdclose_Click()
If MsgBox("Are you sure you want to close the application?", vbQuestion + vbYesNo, "Confirm") = vbYes Then
End
End If
End Sub
Private Sub cmdpreview_Click()
Dim ans As VbMsgBoxResult
ans = MsgBox(txtmsg.Text, Val(cmbmsgtype.Text) + Val(cmbbtntype.Text), "Message Preview")
lblbtnclick.Caption = "You clicked "
If ans = vbAbort Then
lblbtnclick.Caption = lblbtnclick.Caption & "Abort"
ElseIf ans = vbCancel Then
lblbtnclick.Caption = lblbtnclick.Caption & "Cancel"
ElseIf ans = vbIgnore Then
lblbtnclick.Caption = lblbtnclick.Caption & "Ignore"
ElseIf ans = vbNo Then
lblbtnclick.Caption = lblbtnclick.Caption & "No"
ElseIf ans = vbOK Then
lblbtnclick.Caption = lblbtnclick.Caption & "OK"
ElseIf ans = vbRetry Then
lblbtnclick.Caption = lblbtnclick.Caption & "Retry"
Else
lblbtnclick.Caption = lblbtnclick.Caption & "Yes"
End If
End Sub
Private Sub cmdmsg_Click()
txtmsg.Text = InputBox("Enter your message here: ", "Input Box Message", txtmsg.Text)
End Sub
If MsgBox("Are you sure you want to close the application?", vbQuestion + vbYesNo, "Confirm") = vbYes Then
End
End If
End Sub
Private Sub cmdpreview_Click()
Dim ans As VbMsgBoxResult
ans = MsgBox(txtmsg.Text, Val(cmbmsgtype.Text) + Val(cmbbtntype.Text), "Message Preview")
lblbtnclick.Caption = "You clicked "
If ans = vbAbort Then
lblbtnclick.Caption = lblbtnclick.Caption & "Abort"
ElseIf ans = vbCancel Then
lblbtnclick.Caption = lblbtnclick.Caption & "Cancel"
ElseIf ans = vbIgnore Then
lblbtnclick.Caption = lblbtnclick.Caption & "Ignore"
ElseIf ans = vbNo Then
lblbtnclick.Caption = lblbtnclick.Caption & "No"
ElseIf ans = vbOK Then
lblbtnclick.Caption = lblbtnclick.Caption & "OK"
ElseIf ans = vbRetry Then
lblbtnclick.Caption = lblbtnclick.Caption & "Retry"
Else
lblbtnclick.Caption = lblbtnclick.Caption & "Yes"
End If
End Sub
Private Sub cmdmsg_Click()
txtmsg.Text = InputBox("Enter your message here: ", "Input Box Message", txtmsg.Text)
End Sub