Display information with WPF MessageBox : MessageBox « Windows Presentation Foundation « C# / CSharp Tutorial






using System;
using System.Windows;
using System.Windows.Input;

    class MainClass
    {
        [STAThread]
        public static void Main()
        {
            Application app = new Application();

            Window win = new Window();
            win.Title = "Handle An Event";
            win.MouseDown += WindowOnMouseDown;

            app.Run(win);
        }
        static void WindowOnMouseDown(object sender, MouseButtonEventArgs args)
        {
            Window win = sender as Window;
            string strMessage =args.ChangedButton +":"+ args.GetPosition(win);
            MessageBox.Show(strMessage, win.Title);
        }
    }








24.67.MessageBox
24.67.1.Message Only MessageBoxMessage Only MessageBox
24.67.2.MessageBox with Message and HeaderMessageBox with Message and Header
24.67.3.Set Message, Header, and Button for MessageBoxSet Message, Header, and Button for MessageBox
24.67.4.Customize Message, Header, Button, and Image for MessageBoxCustomize Message, Header, Button, and Image for MessageBox
24.67.5.Display a message box and get the message box return value.Display a message box and get the message box return value.
24.67.6.Display information with WPF MessageBox
24.67.7.WPF message box
24.67.8.Question MessageBox