Results 1 to 10 of 10
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MSGBOX (AXP/Win2K)

    Is there a way to control the text of the buttons on a MSGBOX control? I would like to have instead of Yes or No, some other text.

    Thanks,
    Mark

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: MSGBOX (AXP/Win2K)

    Hi Mark,
    I think you will find they are preset. There are more than just yes/no but have a look at the F1 help on the msgbox.
    Pat

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MSGBOX (AXP/Win2K)

    You're limited to the allowable buttons for msgbox controls, and you control which ones appear by including either the additive number that represents the button combination or the vb constants that represent the button in the command that launches the msgbox. If you look in help or in the object browser, you'll find keys like vbYesNo, vbOKOnly, etc. You can't create a button that says something like "Click Here" because that isn't included in the preset constants for button.
    Charlotte

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: MSGBOX (AXP/Win2K)

    As Charlotte pointed out, you are restricted to the defined Buttons names (for example: Yes, No, OK, Cancel). If you want others, you would have to create your own form, making it look like msgbox.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSGBOX (AXP/Win2K)

    As others above have mentioned above, the options are limited. I have created a "custom" MsgBox form and supporting code which permits your choice of text for up to three buttons. I'll post it here if anyone's interested.

    By the way, I think it's a real shortcoming of Windows not to easily allow more informative buttons in the easy-to-use alert boxes and such. I remember reading way back in the early days of GUIs (like the early-to-mid-eighties) that good GUI design includes meaningful button text -- you shouldn't HAVE TO read the whole message box text to figure out which button to press. "Yes", "No", "Cancel", "OK" are examples of "poor technique" (on these grounds anyway). As I type this response into the Woody's Lounge Reply page, I notice the "Check Spelling", "Preview", and "Post It" buttons. These are examples of "good technique". Microsoft apparently does not subscribe to this philosophy.

    Anyway, as Woody said recently... /SOAPBOX OFF

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSGBOX (AXP/Win2K)

    I would love to see this custom messagebox function. Can you post it on the lounge? If it's too big, can you upload it somewhere and post a link...

    Many thanks <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

  7. #7
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSGBOX (AXP/Win2K)

    Thanks Tom,
    Did you attach it? I don't see it.

    Thanks,
    Mark

  8. #8
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSGBOX (AXP/Win2K)

    I haven't posted it yet. It's on my computer at home. Should get it posted by tomorrow morning. It won't be too big (<30 kB zipped, I'd guess).

  9. #9
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSGBOX (AXP/Win2K)

    Thanks!

  10. #10
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSGBOX (AXP/Win2K)

    Here's the custom MsgBox routine that allows you to specify the text for the buttons (plus some other goodies). The attachment is a zipped .mdb file (Access 2000 SR-1) which contains just one form and a VBA module.

    See the comments in the VBA module for instructions on how to use the function call and other information.

    Let me know how it works for you.
    Attached Files Attached Files

Posting Permissions

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