How do you get a class to interact with the form to show a message box?
To display a message box, call the static method MessageBox. Show. The title, message, buttons, and icons displayed in the message box are determined by parameters that you pass to this method.
A message box is a prefabricated modal dialog box that displays a text message to a user. You show a message box by calling the static Show method of the MessageBox class. The text message that is displayed is the string argument that you pass to Show.
Access to the message box is provided by the MessageBox class. A message box is displayed modally. And the code that displays the message box is paused until the user closes the message box either with the close button or a response button.
using System.Windows.Forms; ... MessageBox.Show("Hello World!");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With