Luke Parker's example can be slicked up a bit if you make your own MessageBox class (sadly it can't be done as an extension method because there isn't an available instance of MessageBox):
namespace System.Windows.Forms
{
public static class MessageBoxLines
{
public static void Show(string[] lines)
{
MessageBox.Show(string.Join(Environment.NewLine, lines));
}
}
}
You'd use it like:
MessageBoxLines.Show(new[] { "Line1", "Line2"} );
You'd add more overloads or optional parameters for the other forms (those that take a caption, specify the buttons etc
This could be tidied further if you use a params array:
public static void Show(params string[] lines)
{
MessageBox.Show(string.Join(Environment.NewLine, lines));
}
Which you'd use like:
MessageBoxLines.Show("Line1", "Line2" );
But using params would possibly interfere with the standard pattern for the other overloads (buttons etc) so you'd have to get more cute working that one out, either by rearranging the order so params is last or by putting all the args into a params object and digging them out / casting them back to what they should be (which clowns intellisense a bit)