Search code examples
c#conventions

Text naming convention for an object that has a following dialog


I am coding a C# forms application, and have a question in relation to the text property of a button where a messagebox is shown on the button's click event.

The button is a remove button that shows a messagebox where the user can press yes, no or cancel.

In the above situation, should the text of the button have the "..." characters following the text of the button?

With menuStrip items, and a form is displayed, the convention is to have the "..." characters after the text property of the menuStrip item. When following this convention, should the remove button have the same "..." characters.


Solution

  • One element of creating a good user interface is consistency. I assume that you want to create a user interface that is consistent with similar user interfaces on Windows.

    Microsoft has published a user experience guide that contains the a guideline regarding using ellipsis with commands (buttons and menu items):

    Indicate a command that needs additional information (including confirmation) by adding an ellipsis at the end of the button label.

    So if your command opens a message box which requires further input or opens another dialog box where the user has to provide input you should use the ellipsis. But if the command doesn't open a secondary window, or the purpose of the command is to open a secondary window like an about box or a dialog box with options then no ellipsis should be used.

    Microsoft provides a rationale for this design:

    Proper use of ellipses is important to indicate that users can make further choices before performing the action, or even cancel the action entirely. The visual cue offered by an ellipsis allows users to explore your software without fear.

    Your specific case where confirmation is required is included in the guideline that states that you should add ellipsis. Your users will know that they can invoke the remove button without fear.