The RADvolution Form contains simple methods to show messages.
Automatically the correct MessageBoxProvider is used and the correct caption and icon are shown.


Examples (C#)
  • ShowMessage(“Error 123 occured.”, MessageBoxType.Error);
  • ShowInformation(“You completed the order.”);
  • ShowError(“The {0} of this order is not correct.", NameTextBox);
  • ShowWarning(“You did not complete the order correctly.”);
  • if (AskQuestion(“Do you want to clear the {0}?", NameTextBox) == DialogResult.Yes)
        NameTextBox.Text = "";

    result:

Easy prompt referencing
You can use "{0}" in the message text to refer to the Text of the prompt belonging to a control (‘&’ and ‘:’ are automatically removed).

Example: ShowInformation(“The {0} of this order is not correct.", NameTextBox);

result:



MessageBox independent
All these messages are MessageBoxProvider independent. When you want to use another kind of MessageBox for your complete application these messages automatically make use of this new MessageBox. You can make your own MessageBox by implementing an IMessageBoxProvider. 
 

Caption

By providing the MessageBoxType (such as an Error, Warning, etc.) automatically the correct caption is shown. The captions of these messages are DynamicTextProvider independent.

You can change default captions at 1 place in your application and these captions will automatically be used in all messages.

You can also supply your own custom caption in the message itself by making use of one of the overloaded ShowMessage() methods.


Icon

By providing the MessageBoxType (such as an Error, Warning, etc.) automatically the correct icon is shown. You can also supply a MessageBoxIcon by making use of one of the overloaded ShowMessage() methods.