Results 1 to 4 of 4

Thread: Form?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2009
    Posts
    176

    Form?

    Hello again. Here is my next question:
    Lets say like this: I make a program. And I make a "Quit" button.
    When the user pushes the button there will come up a window with the question"Are you sure" and two buttons, "yes" and "No". Shall this be a new form or is there some way to write this in the msgbox. For example:
    ...
    msgbox "Are you sure (button "Yes") (Button "No")
    ...

  2. #2
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: Form?

    Using QueryUnload...
    Code:
    MsgBox "Sure?", vbYesNo, "Quit"


    Good Luck
    Option Explicit should not be an Option!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2009
    Posts
    176

    Re: Form?

    Quote Originally Posted by vb5prgrmr View Post
    Using QueryUnload...
    Code:
    MsgBox "Sure?", vbYesNo, "Quit"


    Good Luck
    Ok thank you!
    But how shall it be if whan I press Yes then form2.show and when I press no then unload me

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Form?

    If this is in QueryUnload, you don't need to call Unload Me because your form will unload unless you set the Cancel parameter in that event to non-zero.
    Code:
    If MsgBox("Are you sure", vbYesNo, "Quit") = vbYes Then
        
    Else ' No was pressed
    
    End If
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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