How to Create a Message Box?

by firtvid20 in Living > Pranks, Tricks, & Humor

124075 Views, 31 Favorites, 0 Comments

How to Create a Message Box?

Instructables Mesaage Box.jpg
In this instructable, you will learn how to create a message box with notepad on your computer. Below is an example of a message box.

Open Up Notepad

example.jpg
Open up notepad on your computer. Type in the following:

x=msgbox ("yourtexthere" ,0, "yourtitlehere")

Replace 'yourtexthere' with the words you want in your message box and replace 'yourtitlehere' with the title you want on your message box (for example x=msgbox ("Do you want to learn how to make this message box?" ,4, "Instructables").

Editing Your Message Box

Picture1.jpg
Picture2.jpg
Picture11.jpg
Picture3.jpg
Picture4.jpg
Picture5.jpg
Picture6.jpg
Picture7.jpg
Picture8.jpg
Picture9.jpg
Picture10.jpg
all boxes.jpg
To choose the types of buttons or how you want your message box to look like change the number in between the commas.

x=msgbox ("Example Text" ,your number here, "Example Title")

Replace your number here with one of the following:

0 displays the OK button only
1 displays the OK and Cancel buttons
2 displays the Abort, Retry and Ignore buttons
3 displays the Yes, No, Cancel buttons
4 displays the Yes and No buttons
5 displays the Retry and Cancel buttons
16 displays the Critical Message icon
32 displays the Warning Query icon
48 displays the Warning Message icon
64 displays the Information Message icon
4096 is a system modal; all applications are suspended until the user responds to the message box (in other words, this message box stays on top of all applications)

Below is how the boxes will look like.

Saving Your Message Box

save.jpg
Click File and Save As... and save it as yourfilename.vbs. Replace 'yourfilename' with the file name you want (for example instructables.vbs). The .vbs must be left at the end otherwise your message box wont work. Save it somewhere on your computer.

Testing Your Message Box

finish.jpg
Open up the file you saved.

There you have it! A message box created by you.

Some Tips

END.jpg
END.jpg
finish.jpg
If you want you can put more message boxes on your file.
for example:
x=msgbox ("Do you want to learn how to make this message box?" ,4, "Instructables")
x=msgbox ("If you said yes go to the Instructables website" ,0, "Instructables")
x=msgbox ("If you said no close the message box" ,0, "Instructables")

If you want your message box to be uncloseable (when you click a button or the close button the message box will keep on reappearing) type this:

do
x=msgbox ("yourtexthere" ,0, "yourtitlehere")
loop

The only way to stop this is to open up Windows Task Manager, go to the Processes tab and look for wscript.exe and click End Process.