SIGN UP MEMBER LOGIN:    
ARTICLE

Localizable Message Box Control

Posted by g_lazarevic Articles | Windows Controls C# April 02, 2005
This is localizable MessageBox control. Buttons on standard windows message box controls are always Yes, No, Abort, Cancel, OK, Ignore, Retry. I needed different text on my message boxes so I decided to develop custom message box control.
Reader Level:
Download Files:
 

My control is useful for every project. This is localizable MessageBox control. Buttons on standard windows message box controls are always Yes, No, Abort, Cancel, OK, Ignore, Retry. I needed different text on my message boxes so I decided to develop custom message box control. I wrote one Test application just to show how it works. There are 10 predefined constructors.

  • 5 classic like Windows.Forms.MessageBox
    1. public static DialogResult Display(string message,string caption,MessageBoxButtons buttons,MessageBoxIcon icon,MessageBoxDefaultButton defaultButton)
    2. public static DialogResult Display(string message,string caption,MessageBoxButtons buttons,MessageBoxIcon icon)
    3. public static DialogResult Display(string message,string caption,MessageBoxButtons buttons)
    4. public static DialogResult Display(string message,string caption)
    5. public static DialogResult Display(string message)
  • 5 special with predefined text on buttons
    1. public static DialogResult DisplayLocal(string message,string caption,MessageBoxButtons buttons,MessageBoxIcon icon,MessageBoxDefaultButton defaultButton,string yesButtonText,string noButtonText,string abortButtonText)
    2. public static DialogResult DisplayLocal(string message,string caption,MessageBoxButtons buttons,MessageBoxIcon icon,string yesButtonText,string noButtonText,string abortButtonText)
    3. public static DialogResult DisplayLocal(string message,string caption,MessageBoxButtons buttons,string yesButtonText,string noButtonText,string abortButtonText)
    4. public static DialogResult DisplayLocal(string message,string caption,string yesButtonText)
    5. public static DialogResult DisplayLocal(string message,string yesButtonText)

Default text is Serbian Da=Yes, Ne=No and Odustani=Abort.
Dialog result is on of the following:

  • Yes
  • No
  • Cancel

There is no DialogResult.OK, DialogResult.OK, DialogResult.Retry

You can

  • Have maximum 3 buttons
  • Choose one of four Icons (Error, Information, Warning, Question, No icon)
  • Set default button
  • Set text for each button

Here are some screen shots to take a look at:

Example 1:

Example 2:

Login to add your contents and source code to this article
share this article :
post comment
 

"What's an Amazing Performance"  Thanks a lot for improving my instresting knowledge

Posted by Naren Selva Feb 11, 2010
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Gauge for SharePoint
Become a Sponsor