Message Box

I'm using c#.net Windows application

Before delete I want to prompt with a message box..

I want to have only two buttons Yes & No (As I feel cancel has the same functionality as Cancel - so I don't require that button) - But I want the Control Button on my Message Box window (i.e X on the right top of the window)

But without adding the cancel buttong in the buttons - I'm not able to get it...

Is there any other property to add it other than adding the cancel button.




Answer this question

Message Box

  • ThomasBear

    No. The MessageBox class is simply a wrapper around the standard Win32 message box. In this specific case I'm not sure that you'd want the "X" anyway. As a user what would clicking the "X" mean to you If you close the message box are you confirming an action that you initiated or cancelling it It would be a confusing UI to me. I recommend you stick with the Yes/No button and leave the "X" out of it. Nevertheless if you really do want such a UI you can always create your own form that works in that manner instead of relying on MessageBox.

    Michael Taylor - 5/11/06


  • Message Box