You are currently viewing our boards & gives you limited access to the forums. Feel free to join our community. Registration is so easy!
Please click the registration button at the top if you are interested to join. Thank you!

Creating Your Own Simple Message Box

Go down

Creating Your Own Simple Message Box Empty Creating Your Own Simple Message Box

Post  Justin_Romile on Sun Apr 04, 2010 6:20 pm

Hello everyone, have you ever been curious about the message box that pops up occasionally when you are doing something such as warning or alert messages. These message boxes also contains different command buttons such as "Yes", "No", "OK", "Ignore", and etc. To be more understandable for you, here are the example of a simple message box.

Creating Your Own Simple Message Box Messagebox

So to create your own message box just simply follow this steps.

1. Go to start menu > Program Files > Accessories > Notepad or for advance users, just simply run notepad from the start menu.

2. In notepad, type this code:


NOTE 1: I strongly suggest you to re - type the code above instead of copy then paste.

NOTE 2: As you can see in the code "YOUR TEXT HERE" & "TITLE OF YOUR MESSAGE BOX" this means, the text inside the quotes are replaceable but don't forget the quotes, parenthesis, and commas. However, numbers in the code "4+16" is also replaceable. We will discuss it later...

3. After you finished your work, save your file as .vbs instead of .txt
Example: Msgbox.vbs

NOTE: The icon of your work should be like this after you saved it.
Creating Your Own Simple Message Box VBS2%5B1%5D

4. Run your work to see if it works. If not, then you should check your coding by following these steps: Right Click the file > Edit > The notepad should pop up then you would be able to check and edit your coding.

Variables For Replacing The Numbers:

* 0 = vbOKOnly - OK button only
* 1 = vbOKCancel - OK and Cancel buttons
* 2 = vbAbortRetryIgnore - Abort, Retry, and Ignore buttons
* 3 = vbYesNoCancel - Yes, No, and Cancel buttons
* 4 = vbYesNo - Yes and No buttons
* 5 = vbRetryCancel - Retry and Cancel buttons
* 16 = vbCritical - Critical Message icon
* 32 = vbQuestion - Warning Query icon
* 48 = vbExclamation - Warning Message icon
* 64 = vbInformation - Information Message icon
* 0 = vbDefaultButton1 - First button is default
* 256 = vbDefaultButton2 - Second button is default
* 512 = vbDefaultButton3 - Third button is default
* 768 = vbDefaultButton4 - Fourth button is default
* 0 = vbApplicationModal - Application modal (the current application will not work until the user responds to the message box)
* 4096 = vbSystemModal - System modal (all applications wont work until the user responds to the message box)

Posts : 93
Join date : 2009-08-28
Age : 24
Location : Antipolo City, Philippines

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum