CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    429

    Question MessageBox with answer returns

    --Using [VS C#.NET]--

    This is a really simple question...
    How do you make a message box that has a YES/NO and returns a boolean depending on the users response.
    Specifically I want to prompt the user to confirm if he wants to delete the seletected item.
    So like if (messagebox.response) then XXX else YYY type of pseudo-code.

    I am sure this is rather trivial just couldn't find any clear examples.
    Thanks,

  2. #2
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210

    Re: MessageBox with answer returns

    I wish this can help..
    Code:
    DialogResult res= MessageBox.Show(this,"Delete ?","confirm",MessageBoxButtons.YesNo);
    if(res==DialogResult.No)
    	return;
    else
    //Delete
    Hesham A. Amin
    My blog , Articles


    <a rel=https://twitter.com/HeshamAmin" border="0" /> @HeshamAmin

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

Featured