chitika

Tuesday, September 20, 2011

vb: how to use messsage box, yes, no msgbox?

This site provides users with the information about vb, visual basic, vb6, message box, yes, no message box, how to use msgbox, example, and more.

If you think that this site is helpful, please recommend your friends to visit our site.


How to use messsage box, yes, no msgbox in vb?

Let's first look at its syntax as follows:

MsgBox(prompt[, buttons] [, title] [, helpfile,

Prompt: text of the message box
buttons: vbCritical, vbQuestion, vbExclamation, and vbInformation.
title: title of the message box
helpfile: These arguments are only applicable when a Help file has been set up to work with the application. It is optional.

The following is the code for using messsage box, yes, no msgbox in vb:

1. Basic message box / msgbox


--------------------------------------------------------------------------------
MsgBox "Please enter your name first.", _
vbExclamation + vbOKOnly, _
"Account Information"
--------------------------------------------------------------------------------

2. Yes or no message box / msgbox

--------------------------------------------------------------------------------
Dim iResponse As Integer

iResponse = MsgBox("Are you sure that you want to delete all the records?", _
vbYesNo + vbQuestion, _
"Deletion")

If iResponse = vbYes Then
Msgbox "All the records have been deleted!"
else
Msgbox "All the records have not been deleted!"
End If

No comments:

Post a Comment

For other hundreds of computer repair tips, tricks, tweaks, guide, help, please go to


http://website.edusoftmax.com