How to make a simple popup box in Visual C#?

System.Windows.Forms.MessageBox.Show("My message here");

Make sure the System.Windows.Forms assembly is referenced your project.


Just type mbox then hit tab it will give you a magic shortcut to pump up a message box.


Try this:

string text = "My text that I want to display";
MessageBox.Show(text);

In Visual Studio 2015 (community edition), System.Windows.Forms is not available and hence we can't use MessageBox.Show("text").

Use this Instead:

var Msg = new MessageDialog("Some String here", "Title of Message Box");    
await Msg.ShowAsync();

Note: Your function must be defined async to use above await Msg.ShowAsync().


Nothing fancy? Try MessageBox

http://www.homeandlearn.co.uk/csharp/csharp_s1p9.html