Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Computers (https://www.askmehelpdesk.com/forumdisplay.php?f=242)
-   -   Messagebox making (https://www.askmehelpdesk.com/showthread.php?t=282917)

  • Nov 19, 2008, 02:30 PM
    drdradle
    Messagebox making
    Hello all. I was wandering how to make a message box that will have more than just one message in it, like when you press OK it will go to another message instead of just closing, I use to do it a few years ago to play pranks on my friends but I forgot how to do it. Also, is it passable to make it in a .bat file rather than a .vbs, I think I have seen it done before but I'm not sure how to do it. Thank you.
  • Nov 19, 2008, 02:32 PM
    Curlyben
    Depends on the style you are wanting.
    A .bat will produce the normal black command box.
    Adding a PAUSE will prompt to press any key to continue.
  • Nov 19, 2008, 04:37 PM
    chuckhole

    For VBScript:
    The following example uses the MsgBox function to display a message box and return a value describing which button was clicked:

    Dim intMsg1, intMsg2
    intMsg1 = MsgBox ("This is my message that I want you to read!", 65, "Banner Heading")
    ' intMsg1 contains either 1 or 2, depending on which button is clicked.
    If intMsg1 = 1 then
    intMsg2 = MsgBox ("This is the alternate message that will format your hard drive and puncture your tires!", 0, "I am screwed banner")
    end if

    Below are the options for the MsgBox display and buttons. In the first message box, the otion vaule is 65 which is really 64+1. This is how you combine the options:

    vbOKOnly 0 Display OK button only.
    vbOKCancel 1 Display OK and Cancel buttons.
    vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
    vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
    vbYesNo 4 Display Yes and No buttons.
    vbRetryCancel 5 Display Retry and Cancel buttons.
    vbCritical 16 Display Critical Message icon.
    vbQuestion 32 Display Warning Query icon.
    vbExclamation 48 Display Warning Message icon.
    vbInformation 64 Display Information Message icon.
    vbDefaultButton1 0 First button is default.
    vbDefaultButton2 256 Second button is default.
    vbDefaultButton3 512 Third button is default.
    vbDefaultButton4 768 Fourth button is default.
    vbApplicationModal 0 Application modal; the user must respond to the message box before continuing work in the current application.
    vbSystemModal 4096 System modal; all applications are suspended until the user responds to the message box.

  • All times are GMT -7. The time now is 12:39 PM.