Click here to Skip to main content
15,886,801 members
Articles / Programming Languages / C#

Localizing System MessageBox

Rate me:
Please Sign up or sign in to vote.
4.81/5 (96 votes)
2 May 2007CPOL4 min read 344.5K   20.7K   108  
A simple class that allows customizing system's MessageBox window buttons
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace WindowsApplication1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            MessageBoxManager.OK = "Alright";
            MessageBoxManager.Cancel = "Noway";
            MessageBoxManager.Register();
            MessageBox.Show("This is a message...", "Test", MessageBoxButtons.OK);
            MessageBox.Show("This is a message...", "Test", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand);
            new OpenFileDialog().ShowDialog();
            MessageBoxManager.Unregister();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions