Windows phone 8 message box yes no

By using the site you accept the cookie policy. When developing an application using Windows Forms, you will often wish to display a message to the user, or ask a simple yes or no question. In most cases, creating a custom dialog box or window for this purpose would be an inefficient use of time, and may lead to a non-standard dialog box that confuses users. To simplify and standardise displaying this type of dialog box, Windows Forms includes the MessageBox class. The MessageBox class is used to display modal dialog boxes containing a basic message, a title and one or more buttons.

You can also include an icon to show the purpose of the message. When you display a dialog box, the calling form stops responding until the user clicks a button, at which point the message box disappears. You can then detect which button was pressed and act accordingly. The simplest type of message box is displayed using a call to the MessageBox class's Show method , passing the message to display as a string.

We can demonstrate this with a simple example. Now, you might think — what about None? Cancel , even if no Cancel button is pressed. I have a created a simple application to display the different types of Messagebox as explained above. You can download the full source code of the project file from the link given below. Download full project file Messagebox,zip.


  • How to create a simple message box on windows 7/8!
  • Dialog Boxes.
  • Design concepts?
  • uvatyfubozev.tk Method (uvatyfubozev.tks) | Microsoft Docs;
  • How to display message using Message box in Windows phone application?
  • android emulator install apk slow.

You can also refer to the following blog post where I have made an efficient use of the Messagebox class to add app review reminder in Windows phone application. App development is my passion. Believe in quality rather than quantity. Second method The second method by allowing the developer to set the title and actually select, whether there is an OK or OKCancel button set needed. Note: When you want to check the result, you will be prompted with an enumeration of possible values and in fact, it is bigger than you expect: Only OK and Cancel will work if checked against.

You can also help reduce the number of errors by providing reasonable default values. Validate user input as soon as possible, and show errors as closely to the point of input as possible. Use modeless error handling in-place errors or balloons for user input problems. Use balloons for non-critical, single-point user input problems detected while in a text box or immediately after a text box loses focus. Balloons don't require available screen space or the dynamic layout that is required to display in-place messages.

Display only a single balloon at a time. Because the problem isn't critical, no error icon is necessary. Balloons go away when clicked, when the problem is resolved, or after a timeout. Use in-place errors for delayed error detection , usually errors found by clicking a commit button.

Don't use in-place errors for settings that are immediately committed. There can be multiple in-place errors at a time. Use normal text and a 16x16 pixel error icon, placing them directly next to the problem whenever possible. In-place errors don't go away unless the user commits and no other errors are found. Use modal error handling task dialogs or message boxes for all other problems, including errors that involve multiple controls, or are non-contextual or non-input errors found by clicking a commit button.

When an input problem is found and reported, set input focus to the first control with the incorrect data. Scroll the control into view if necessary. For more information and examples, see Error Messages and Balloons. When providing user assistance, consider the following options listed in their order of preference :. Locate Help links at the bottom of the content area of the dialog box. If the dialog box has a footnote and the Help link is related to it, place the Help link within the footnote. Don't use general or vague Help topic links or generic Help buttons.

Users often ignore generic Help. For more information and examples, see Help. In this example, users are most likely to choose the same printing settings as they did last time. However, the number of copies desired is likely to change, so this setting isn't reselected. However, phrasing must match the associated command, even if the command is negatively phrased; so, for example, use disable to confirm a Disable command. For more information and examples, see Command Link guidelines. Skip to main content. Exit focus mode.

Theme Light. High contrast. Profile Sign out. A typical dialog box. Dialog boxes have two fundamental types: Modal dialog boxes require users to complete and close before continuing with the owner window. These dialog boxes are best used for critical or infrequent, one-off tasks that require completion before continuing. Modeless dialog boxes allow users to switch between the dialog box and the owner window as desired.

These dialog boxes are best used for frequent, repetitive, on-going tasks. They consist of the following parts, which can be assembled in a variety of combinations: A title bar to identify the application or system feature where the dialog box came from. A main instruction , with an optional icon, to identify the user's objective with the dialog. A content area for descriptive information and controls. A command area for commit buttons, including a Cancel button, and optional More options and Don't show this again controls.

A footnote area for optional additional explanations and help, typically targeted at less experienced users. A typical task dialog. A typical task pane. Is this the right user interface? To decide, consider these questions: Is the purpose to provide users with information, ask users a question, or allow users to select options to perform a command or task?

If not, use another user interface UI. Is the purpose to view and change properties for an object, collection of objects, or a program? If so, use a property window or toolbar instead. Is the purpose to present a collection of commands or tools? If so, use a toolbar or palette window. Is the purpose to verify that the user wants to proceed with an action?

Is there a clear reason not to proceed and a reasonable chance that sometimes users won't? If so, use a confirmation. Is the purpose to give an error or warning message?

Design concepts

If so, use an error message or warning message. Is the purpose to: Open files Save files Open folders Find or replace text Print a document Select attributes of a printed page Select a font Choose a color Browse for a file, folder, computer, or printer Search for users, computers, or groups in Microsoft Active Directory Prompt for a user name and password? Is the purpose to perform a multi-step task that requires more than a single window? If so, use a task flow or wizard instead. Is the purpose to inform users of a system or program event that isn't related to the current user activity, that doesn't require immediate user action, and users can freely ignore?

If so, use a notification instead. Is the purpose to show program status? If so, use a status bar instead. Would it be preferable to use in-place UI? Dialog boxes can break the user's flow by demanding attention. Sometimes that break in flow is justified, such as when the user must perform an action that is outside the current context.

In other cases, a better approach is to present the UI in context, either directly with in-place UI such as a task pane , or on demand using progressive disclosure. Is the purpose to display a non-critical user input problem or special condition? If so, use a balloon instead. For task flows, would it be preferable to use another page?

Generally you want a task to flow from page to page within a single window. Use dialog boxes to confirm in-place commands, to get input for in-place commands, and to perform secondary, stand-alone tasks that are best done independently and outside the main task flow. For selecting options, are users likely to change the options? If not, consider alternatives, such as: Using the default options without asking, but allowing users to make changes later.

Providing a version with options for example, Print Generally, toolbar commands should be immediate and avoid displaying dialog boxes. For selecting options, is there a simpler, more direct way to present the options? If so, consider alternatives, such as: Using a split button to select variations of a command. Using a submenu for commands, check boxes, radio buttons and simple lists.

Visual C++ Tutorial 31 -Windows Forms Application: Message Box Asking if The User Wants To Exit

In these examples, submenus are used instead of dialog boxes for simple selections. Design concepts When properly used, dialog boxes are a great way to give power and flexibility to your program. To design effective dialog boxes, use the following elements effectively: Dialog box text Main instructions Don't show this again option If you do only one thing Usage patterns Dialog boxes have several usage patterns: Question dialogs using buttons ask users a single question or to confirm a command, and use simple responses in horizontally arranged command buttons.

Question dialogs using command links ask users a single question or to select a task to perform, and use detailed responses in vertically arranged command links. Choice dialogs present users with a set of choices, usually to specify a command more completely. Unlike question dialogs, choice dialogs can ask multiple questions.

Progress dialogs present users with progress feedback during a lengthy operation longer than five seconds , along with a command to cancel or stop the operation. Informational dialogs display information requested by the user. Guidelines General Don't use scrollable dialog boxes. Exception: Menu bars are acceptable when a dialog box is used to implement a primary window such as a utility. Incorrect: In this example, Find Certificates is a modeless dialog box with a menu bar.

Modal dialog boxes Use for critical or infrequent, one-off tasks that require completion before continuing. Use a delayed commit model so that changes don't take effect until explicitly committed. Implement using a task dialog whenever appropriate to achieve a consistent look. Task dialogs do require Windows Vista or later, so they aren't suitable for earlier versions of Windows. Modeless dialog boxes Use for frequent, repetitive, on-going tasks.

Use an immediate commit model so that changes take effect immediately.

Message Boxes

For modeless dialogs, use an explicit Close command button in the dialog to close the window. For both, use a Close button on the title bar to close the window. Consider making modeless dialog boxes dockable. Dockable modeless dialogs allow for more flexible placement. Some modeless dialog boxes used in Microsoft Office are dockable. Multiple dialog boxes Don't display more than one owned choice dialog at a time from an owner choice dialog.

Displaying more than one makes the meaning of the commit buttons difficult for users to understand. You may display other types of dialog boxes such question dialogs as needed. For a sequence of related dialogs, consider using a multi-page dialog if possible. Use individual dialogs if they aren't clearly related. Multi-page dialog boxes Use a multi-page dialog box instead of individual dialog boxes when you have the following sequence of related pages: A single input page optional A progress page A single results page The input page is optional because the task may have been initiated somewhere else.


  • Windows Forms Message Boxes.
  • Post navigation.
  • western governors university application fee waiver code.
  • angry birds mobile game free download for sony ericsson!
  • Is this the right user interface?.
  • Your Answer.
  • Get Started.

In this example, Windows Network Diagnostics consists of progress and results pages. Don't use a multi-page dialog if the input page is a standard dialog. In this case the consistency of using a standard dialog is more important. Don't use Next or Back buttons and don't have more than three pages.

Multi-page dialog boxes are for single-step tasks with feedback. They aren't wizards , which are used for multi-step tasks. Wizards have a heavy, indirect feel compared to multi-page dialog boxes. On the input page, use specific command buttons or command links to initiate the task. Use a Cancel button on the input and progress pages, and a Close button on the results page.

Presentation To make dialog boxes easy to find and access, clearly associate the dialog with its source, and work well with multiple monitors: Initially display dialogs "centered" on top of the owner window. For subsequent display, consider displaying it in its last location relative to the owner window if doing so is likely to be more convenient. Initially center dialogs on top of the owner window. If a dialog is contextual, display it near the object from which it was launched.

However, place it out of the way preferably offset down and to the right so that the object isn't covered by the dialog.

Dialog Boxes

An object's properties are displayed near to the object. For modeless dialogs, display initially on top of the owner window to make it easy to find. If the user activates the owner window, that may obscure the modeless dialog. If necessary, adjust the initial location so that the entire dialog is visible within the target monitor. If a resizable window is larger than the target monitor, reduce it to fit.

When a dialog is redisplayed, consider displaying it in the same state as last accessed. On close, save the monitor used, window size, location, and state maximized vs. On redisplay, restore the saved dialog size, location, and state using the appropriate monitor. Also, consider making these attributes persist across program instances on a per-user basis. For resizable windows, set a minimum window size if there is a size below which the content is no longer usable. Consider altering the presentation to make the content usable at smaller sizes. Don't use the Always on Top attribute.

Exception: Use only when a dialog box implements an essentially modal operation, but it needs to be suspended briefly to access the owner window. For example, when spell-checking a document, users may occasionally leave the spell check dialog box and access the document to correct errors. Title bars Dialog boxes don't have title bar icons. Title bar icons are used as a visual distinction between primary windows and secondary windows. Exception: If a dialog box is used to implement a primary window such as a utility and therefore appears on the taskbar, it does have a title bar icon.

In this case, optimize the title for display on the taskbar by concisely placing the distinguishing information first. Dialog boxes always have a Close button. Modeless dialogs can also have a Minimize button. Resizable dialogs can have a Maximize button. Don't disable the Close button. Having a Close button helps users stay in control by allowing them to close windows they don't want.

Exception: For progress dialogs, you may disable the Close button if the task must run to completion to achieve a valid state or prevent data loss. The Close button on the title bar should have the same effect as the Cancel or Close button within the dialog box. Never give it the same effect as OK. If the title bar caption and icon are already displayed in a prominent way near the top of the window, you can hide the title bar caption and icon to avoid redundancy. However, you still have to set a suitable title internally for use by Windows.

Interaction When displayed, user initiated dialog boxes should always take input focus. Usually tab order follows reading order, but consider making these exceptions: Put the most commonly used controls earlier in tab order. Put Help links at the bottom of a dialog box, after the commit buttons in tab order. Access keys Whenever possible, assign unique access keys to all interactive controls or their labels.

Don't assign access keys to: OK, Cancel, and Close buttons. In this example, the positive commit button has an access key assigned. Generic Help buttons, which are accessed with F1. Tab names. Prefer characters with wide widths, such as w, m, and capital letters. Prefer a distinctive consonant or a vowel, such as "x" in Exit. Avoid using characters that make the underline difficult to see, such as from most problematic to least problematic : Letters that are only one pixel wide, such as i and l.

Letters with descenders, such as g, j, p, q, and y. Letters next to a letter with a descender. Progress dialogs For long-running tasks, assume that users will do something else while the task is completing. Present users with progress feedback dialog box if an operation takes longer than five seconds to complete , along with a command to cancel or stop the operation. Exception: For wizards and task flows, use a modal dialog for progress only if the task stays on the same page as opposed to advancing to another page and users can't do anything while waiting.

Otherwise, use a progress page or in-place progress. If the operation is a long-running task over 30 seconds and can be performed in the background, use a modeless progress dialog so that users can continue to use your program while waiting. Modeless progress dialogs: Have a Minimize button on the title bar. Are displayed on the taskbar. Implement modeless progress dialogs so that they continue to run even if the owner window is closed. In this example, the file copy continues even if the owner window is closed.

Provide a command button to halt the operation if it takes more than a few seconds to complete, or has the potential never to complete. Label the button Cancel if canceling returns the environment to its previous state leaving no side effects ; otherwise, label the button Stop to indicate that it leaves the partially completed operation intact.

You can change the button label from Cancel to Stop in the middle of the operation, if at some point it isn't possible to return the environment to its previous state. In this example, halting the problem diagnosis has no side effect. Provide a command button to pause the operation if it takes more than several minutes to complete, and it impairs users' ability to get work done. Doing so doesn't force the user to choose between completing the task and getting their work done. Gather as much information as you can before starting the task.

If recoverable problems are detected, have users deal with all problems found at the end of the task. If that isn't practical, have users deal with problems as they happen. Don't abandon tasks as the result of recoverable errors. Indicate problems by turning the progress bar red. In this example, a removable disk was removed during a file copy. If the results are clearly apparent to users, close the progress dialog automatically on successful completion.

Otherwise, use feedback only to report problems: To display simple feedback, display the feedback in the progress dialog, and change the Cancel button to Close. To display detailed feedback, close the progress dialog box and display an informational dialog. Time remaining Use the following time formats.

How to display message using Message box in Windows phone application - Windows App Tutorials

Start with the first of the following formats where the largest time unit isn't zero, then change to the next format once the largest time unit becomes zero. For progress bars: If related information is shown in a colon format: Time remaining: h hours, m minutes Time remaining: m minutes, s seconds Time remaining: s seconds If screen space is at a premium: h hrs, m mins remaining m mins, s secs remaining s seconds remaining Otherwise: h hours, m minutes remaining m minutes, s seconds remaining s seconds remaining For title bars: hh:mm remaining mm:ss remaining 0:ss remaining This compact format shows the most important information first so that it isn't truncated on the taskbar.

Make estimates accurate, but don't give false precision. If largest unit is hours, give minutes if meaningful but not seconds. Incorrect: hh hours, mm minutes, ss seconds Keep the estimate up-to-date. Update time remaining estimates at least every 5 seconds. Focus on the time remaining because that is the information users care about most.

Give total elapsed time only when there are scenarios where elapsed time is helpful such as when the task is likely to be repeated. If the time remaining estimate is associated with a progress bar, don't have percent complete text because that information is conveyed by the progress bar itself. Be grammatically correct. Use singular units when the number is one. Incorrect: 1 minutes, 1 seconds Use sentence-style capitalization. Icons and graphics Graphics Don't use large graphics that serve no purpose beyond filling space with eye candy.

Keep the appearance simple instead.