Displaying Messages Using the MessageBox.Show() Method

A message box is a small dialog box that displays a message to the user. Message boxes are often used to tell the user the result of some action, such as The file has been copied. or The file could not be found. A message box is dismissed when the user clicks one of the message box's available buttons. Most applications have many message boxes, yet developers often don't display messages correctly. It's important to remember that when you display a message to a user, you're communicating with the user. In this section, I want to teach you not only how to use the MessageBox.Show() method to display messages, but how to use the statement effectively.

The MessageBox.Show() method can be used ...

Get Sams Teach Yourself C#™ in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.