Results 1 to 7 of 7

Thread: [RESOLVED] Do not ask again feature in MsgBox

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    36

    Resolved [RESOLVED] Do not ask again feature in MsgBox

    I have a button that is supposed to close my program. When you click the button a msgbox will come up that asks for confirmation, however I would like to add a check mark that says "Do not ask me again" which will prompt the msgbox not to appear the next time that the button is clicked how can I do this?

    Here is what I have so far,

    Code:
    Private Sub Command1_Click()
    Select Case MsgBox("Do you really wish to quit this program?", vbOKCancel + vbQuestion, "Confirmation")
    Case vbOK
    Unload Me
    End Select
    End Sub

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Do not ask again feature in MsgBox

    You'll probably need to use a Form instead of a message box so you can add the check box in there...

    Then you can save the check box's value to a file or the registry and check the value of that file before showing the form.

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    30

    Re: Do not ask again feature in MsgBox

    Without some serious API/Subclassing you wont be able to add a checkbox to VB's standard messagebox. My suggestion is use a third party msgbox control that has this option, or to create your own msgbox replacement using a form.

  4. #4

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    36

    Re: Do not ask again feature in MsgBox

    Quote Originally Posted by MartinLiss
    Here you go.
    Thanks.

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Do not ask again feature in MsgBox

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful you have the ability to affect a their forum "reputation" by rating their post. BTW, no need to do it for me.

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2007
    Posts
    36

    Re: Do not ask again feature in MsgBox

    Quote Originally Posted by MartinLiss
    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful you have the ability to affect a their forum "reputation" by rating their post. BTW, no need to do it for me.
    Oh okay, I didn't know that

Posting Permissions

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



Click Here to Expand Forum to Full Width