+ Reply to Thread
Results 1 to 4 of 4

msgbox

  1. #1
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    msgbox

    hey all,

    is it possible to add some custom pics to msg box's as well as the exclumation, warning and stop sign's ?

  2. #2
    Bob Phillips
    Guest

    Re: msgbox

    You could easily do that with a custom userform.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "ceemo" <[email protected]> wrote in
    message news:[email protected]...
    >
    > hey all,
    >
    > is it possible to add some custom pics to msg box's as well as the
    > exclumation, warning and stop sign's ?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:

    http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=480364
    >




  3. #3
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    msgbox

    thnx for reply.


    if there's no way of adding custom msgbox's then that will be the way i'll go. It's nice to not have to create loads of forms just for prompts etc

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Ceemo,

    To add the Exclamation, Stop sign, Question mark, or Information icons to your message box, you set the "Buttons" parameter using VB constants. Yoiu can also control the buttons that are displayed (Ok, Yes, No, Cancel, etc.)

    Message Icon Constants:
    The Exclamation = vbExclamation.
    The Stop sign = vbCritical.
    The Question mark = vbQuestion
    Information (talking head) = vbInformation

    Button Constants:
    OK = vbOKOnly
    OK and Cancel = vbOKCancel
    Yes and No = vbYesNo
    Yes and No and Cancel = vbYesNoCancel
    Retry and Cancel = vbRetryCancel
    Abort and Retry and Ignore = vbAbortRetryIgnore


    Example 1:
    MsgBox "Error!", vbCritical + vbOKOnly

    This dispalys the message "Error!" with the Stop Sign icon and the OK response button. OK is the default button. You can use these same constants to check which button was selected.


    Example 2:
    X = MsgBox("Click a button", vbInformation + vbOkCancel, "Message Box Test")
    If X = vbOk Then
    MsgBox "You chose Ok."
    Else
    MsgBox "You chose Cancel"
    End If

    Displays a message box with 2 buttons "Ok" and "Cancel". When you click one, another message box is displayed showing which button you clicked.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1