CodeItBetter Programming Another VB Programming Blog

How to Check whether the user pressed the Cancel Button on Input Box

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
'Coding Basics - How to Check whether the user pressed the Cancel Button on Input Box

Private Sub Command1_Click()
    Dim str As String
    str = InputBox("Press OK or Cancel")
    If StrPtr(str) = 0 Then
       MsgBox "The user pressed the Cancel button"
    End If
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.