Results 1 to 3 of 3

Thread: MessageBox problem..

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    MessageBox problem..

    hi! i have a MessageBox with Yes and No button in it...my question is, how will I know if the User pressed Yes or No...thanks in advance!!!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: MessageBox problem..

    MessageBox.Show returns a Windows.Forms.DialogResult value that corresponds to the button that was pressed, e.g.
    Code:
    if (MessageBox.Show("Are you attractive?", 
                        "Beauty Quest", 
                        MessageBoxButtons.YesNo , 
                        MessageBoxIcon.Question) == DialogResult.Yes)
    {
        MessageBox.Show("Liar!  You are butt ugly.");
    }
    else
    {
        MessageBox.Show("I agree.  You are butt ugly.");
    }
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: MessageBox problem..

    ok thanks so much!!!

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