|
-
July 22nd, 2012, 12:40 AM
#1
How to use Msgbox with Escapekey in VB6
I have tried to end my program with following procedure:-
1. When i press Escapekey in keyboard it should display messagebox stating 'Do you want to Quit?" with Yes or No Option
Remark: its work up to this.
2. But When i click on Yes button option, It wont work for me. i have used following and it display "compile error: Argument not optional"
Please correct me...
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then
MsgBox ("Do you want to quit"), vbYesNo, "You are clossing your program"
If MsgBox = vbYes Then
End
Else
Me.Show
End If
End If
End Sub
Thank you in advance....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|