VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Explains how to select an msgbox answer and have a result for it.

by LODZ (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 25th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Explains how to select an msgbox answer and have a result for it.

Rate Explains how to select an msgbox answer and have a result for it.




Private Sub Form_Load()
result = MsgBox("Thats all you need.", vbOKCancel, Now) 'this will dim result as the msgbox
If result = 1 Then Text1.Text = "You clicked 'OK'" 'if you clicked OK then this will be shown
If result = 2 Then Text1.Text = "You clicked 'Cancel'" 'if you clicked Cancel then this will appear

'1 is for vbOK
'2 is for vbCancel
'3 is for vbAbort
'4 is for vbRetry
'5 is for vbIgnore
'6 is for vbYes
'7 is for vbNo

End Sub


Download this snippet    Add to My Saved Code

Explains how to select an msgbox answer and have a result for it. Comments

No comments have been posted about Explains how to select an msgbox answer and have a result for it.. Why not be the first to post a comment about Explains how to select an msgbox answer and have a result for it..

Post your comment

Subject:
Message:
0/1000 characters