How to

open message box

Published: 1. February 2012 | Updated: 1. February 2012
License: Microsoft Public License (MS-PL)
Categories: Winforms, WPF
Tags: C# UI Windows Winforms WPF
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at analyzant.com

In WPF

using System.Windows;
MessageBox.Show("text", "caption", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes);

In Winforms

using System.Windows.Forms;
MessageBox.Show("text", "caption", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
Send us feedback about this snippet »



Related Snippets: