19.12.2012 Views

Microsoft Visual Basic 6.0

Microsoft Visual Basic 6.0

Microsoft Visual Basic 6.0

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Message box<br />

It is used to output a message to the user (at running stage) the code needed could be<br />

written in code sheet and in any event or command.<br />

The available icons for message box<br />

structure<br />

vbcritical<br />

vbquestion<br />

vbexclamation<br />

vbinformation<br />

The available commands for message box<br />

structure<br />

value<br />

Vbokonly<br />

0<br />

Vbokcancel<br />

1<br />

vbAbortRetryIgnor<br />

2<br />

vbYesNoCancel<br />

3<br />

vbYesNo<br />

4<br />

vbRetryCancel<br />

5<br />

value<br />

16<br />

32<br />

48<br />

64<br />

26<br />

icon<br />

Commands<br />

Ok<br />

Ok, Cancel<br />

Abort, Retry, Ignore<br />

Yes, No, Cancel<br />

Yes, No<br />

Retry, Cancel<br />

For example if we write the following statement then a message box will be appear as<br />

shown below<br />

MsgBox "please close your program", 16, "Error"<br />

or<br />

MsgBox "please close your program", vbcritical, "Error"<br />

Example: show what appear after running the following statement<br />

MsgBox "are you sure you want to delete this file", 32 + 4, "delete"<br />

or<br />

MsgBox "are you sure you want to delete this file",vbQuestion+vbYesNo,"delete"<br />

Sol:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!