Ask Experts Questions for FREE Help !
Ask
    drdradle's Avatar
    drdradle Posts: 45, Reputation: 2
    Junior Member
     
    #1

    Nov 19, 2008, 02:30 PM
    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.
    Curlyben's Avatar
    Curlyben Posts: 18,488, Reputation: 1859
    BossMan
     
    #2

    Nov 19, 2008, 02:32 PM
    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.
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #3

    Nov 19, 2008, 04:37 PM

    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

IS it me or is making out and sex all around me? [ 20 Answers ]

Seriously, maybe I have just been more aware because of my age but I feel like there is always things like people making out or sex or 3rd base or whatever all around me, I feel very inexpirienced and every time I am feeling slightly more secure or okay about it, just another little thought pops...

98 accord making clunking noise when making hard left turn [ 3 Answers ]

My 98 accord ia making a clunk, clunk, clunk sound when making hard left turns. It only does this with left turns a slow speed like making a u-turn. It actually seems to make the car bounce a little with each clunk. It is definitely not a clicking noise. I have just put a prelude h22 engine with...

Making a will [ 2 Answers ]

I have a will, but it needs to be updated? What is the cheapest and reputable way to do that? Thanks in advance.

Ex girlfriend making me want to end it all [ 24 Answers ]

I've never done something like this - post on an internet message board, but I need help. I'm more depressed then anything and I just don't want to bother with life anymore. I know its my ex causing it but I just can't see past that. She is killing me. I was with her for almost 2 years. Its been...


View more questions Search