Click here to Skip to main content
15,895,142 members
Articles / Desktop Programming / Win32

Custom Featured MessageBox

Rate me:
Please Sign up or sign in to vote.
2.80/5 (9 votes)
11 Feb 2008CPOL5 min read 52.6K   1K   26  
A MessageBox that works as we want.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Custom_Featured_MessageBox;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {            
            XMessageBox.show("Delete MessageBox with Yes, No and Cancel buttons, BackColor is Control and ForeColor is Black.", "Example", XMessageBoxButtons.YesNoCancel, XMessageBoxIcon.Delete);
            XMessageBox.show("Simple MessageBox with OK button, BackColor is LightSkyBlue and ForeColor is Black.", "Example", Color.LightSkyBlue, Color.Black, XMessageBoxButtons.OK);
            XMessageBox.show("Simple MessageBox with Abort, Retry and Ignore buttons, BackColor is LightCyan and ForeColor is Black.", "Example", Color.LightCyan, Color.Black, XMessageBoxButtons.AbortRetryIgnore);
            XMessageBox.show("Error MessageBox with OK button, BackColor is LightGreen and ForeColor is Black.", "Example", Color.LightGreen, Color.Black, XMessageBoxButtons.OK, XMessageBoxIcon.Error);
            XMessageBox.show("Information MessageBox with Yes and No buttons, BackColor is LightPink and ForeColor is Black.", "Example", Color.LightPink, Color.Black, XMessageBoxButtons.YesNo, XMessageBoxIcon.Information);
        }
    }
}

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
CEO
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions