Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 945937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:50:04+00:00 2026-05-15T22:50:04+00:00

In my projects (WPF) I use System.Windows.MessageBox to show the user a confirmation dialog

  • 0

In my projects (WPF) I use System.Windows.MessageBox to show the user a confirmation dialog for operations that are critical, such as a delete-operation.

My problem is that if I specify as button value MessageBoxButton.YesNo, the user cannot use the escape-key to cancel the operation. IMO this is one of the most annoying things, a program can do, showing a dialog without the possibility to cancel/close the dialog through the escape-key.

Other possibilities are MessageBoxButton.YesNoCancel, but IMO this is confusing because it shows three buttons for only two operations . Or one can use MessageBox.OKCancel, but this is IMO not clear enough. In my dialogs I want to ask the user if her really wants to execute the operation. And for this, a simple ok is not appropriate. A yes (I want) is much better than an ok (go on).

How do you handle this? Is it a non-topic or do you think as I do and have an own MessageBox-implementation or do you know a possibility to extend the System.Windows.MessageBox-class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:50:04+00:00Added an answer on May 15, 2026 at 10:50 pm

    Make a custom message box (inheriting from Window) that has placeholders for header/message and confirmation button text. Then you can design a nice, attention-grabbing dialog that will stand out from the hundreds of standard OK/Cancel MessageBoxes a user typically sees. For example, you can use a larger header font similar to the Windows Vista dialogs, or include a custom image.

    Then, you could obviously handle the Escape key yourself, and define the default Escape behavior on a per-dialog basis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes I create some quick personal projects using C# with Windows Forms or WPF
Looking at the C# project templates in VS2008 and the offerings are WPF User
Some projects have properties have miscellaneous settings such as: AllowPayments, ShowSideBar, SectionTitle. Really things
There are two projects in one VS solution: client(wpf app) and а wcf service
In my WPF Project I have a WPF Window. I want to use Sticky
I would like to use the same project (class library) in Silverlight and WPF.
I have a project with many WPF Windows. 1 particular Window doesn't open in
I have a WPF project and I'm trying to setup a NAnt build script
I am starting a WPF project, which will be fairly complicated in complexity and
I started a new WPF project in VS2008 and then added some code to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.