Results 1 to 7 of 7

Thread: [RESOLVED] [2005] yes no button question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Hong Kong
    Posts
    384

    Resolved [RESOLVED] [2005] yes no button question

    MessageBox.Show("1 or 2? ", "??", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)

    how to make
    if message box click yes, then show "1"
    else click no then show "2" ?

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] yes no button question

    do you mean this??

    Code:
            If MessageBox.Show("1 or 2? ", "??", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = Windows.Forms.DialogResult.Yes Then
                MessageBox.Show("1")
            Else
                MessageBox.Show("2")
            End If

  3. #3
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: [2005] yes no button question

    You can't ask the question "1 or 2" and with a permissible answer of Yes or No, so it sounds like you should make your own dialog form.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] yes no button question

    Quote Originally Posted by Bulldog
    You can't ask the question "1 or 2" and with a permissible answer of Yes or No, so it sounds like you should make your own dialog form.
    I do agree it sounds a bit confusing.

    To use the built in messagebox, I would suggest changing the wording to something like "Click Yes for 1, Click No for 2" or something like that.

    Making your own form to be like a messagebox is also a pretty painless procedure.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Hong Kong
    Posts
    384

    Re: [2005] yes no button question

    Quote Originally Posted by kleinma
    I do agree it sounds a bit confusing.

    To use the built in messagebox, I would suggest changing the wording to something like "Click Yes for 1, Click No for 2" or something like that.

    Making your own form to be like a messagebox is also a pretty painless procedure.
    ya, my meaning is to give the user to choose,
    if you click yes, then do something
    else if you click no, then you will do another thing.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] yes no button question

    well then my first post with the code example shows you how to do that

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Hong Kong
    Posts
    384

    Re: [2005] yes no button question

    Quote Originally Posted by kleinma
    well then my first post with the code example shows you how to do that
    wow, that's great! thx Moderator

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