We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

There are a way to change the text on Yes / No Buttons, inside a MessageBox question ?

I am using MessageBoxAdv to show a question but the buttons does not take the O.S. language it shows on english by default, and the O.S. is in spanish and it shows on english.

7 Replies

MK Mallika Kannan Syncfusion Team July 20, 2017 07:23 AM UTC

Hi Christopher   
   
Thank you for contacting Syncfusion support.   
   
Yes, this reported “MessageBoxAdv Localization” behavior can be achieved by using the ILocalizationProvider Interface.   
   
Please make use the below Code example.   
   
Code example  
   
// Codes in localizer class file   
    internal class localizer : ILocalizationProvider   
    {   
        public string GetLocalizedString(CultureInfo culture, string name, object ctrl)   
        {   
            #region Localization   
   
            switch (name)   
            {   
                #region MessageBoxAdv   
                ///<summary>    
                ///OK Button in Spanish Language    
                ///</summary>   
                case ResourceIdentifiers.OK:   
                    return "De acuerdo";   
   
                ///<summary>   
                ///Cancel Button in Spanish Language   
                ///</summary>                       
                case ResourceIdentifiers.Cancel:   
                    return "Cancelar";   
   
                ///<summary>   
                /// default   
                ///</summary>   
                default:   
                    return string.Empty;   
                    #endregion   
            }   
            #endregion   
        }   
   
//Codes In Form1.cs   
   
LocalizationProvider.Provider = new localizer();   
   
//MessageBox show   
MessageBoxAdv.Show("Metro Theme Anpassung""Das ist Syncfusion MessageBoxAdv Control", System.Windows.Forms.MessageBoxButtons.OKCancel);   
   
Screenshot   
   
     
   
We have also prepared the sample and video for your reference. It can be downloaded from the below link.   
   
   
   
Kindly check this above solution and let us know if it is helpful.   
   
Regards,   
Mallika  
 



CH Christopher July 31, 2017 02:19 PM UTC

Thankyou so mouch Mallika!, it works perfectly!, greetings.



MK Mallika Kannan Syncfusion Team August 1, 2017 04:04 AM UTC

Hi Christopher 
 
Thanks for your update.  
 
We are glad to hear that we have helped you in this.  
 
Please let us know if you need any other assistance.  
 
Regards,               
Mallika 
 



HE Herney Eduardo Duque A replied to Mallika Kannan August 18, 2022 11:41 PM UTC

Hi!


I have used this strategy to change the Yes/No Texts, like this:

// Yes Button in German Language

case ResourceIdentifiers.Yes:

return "SI";


// No Button in German Language

case ResourceIdentifiers.No:

return "NO";


However, when the Dialogbox is shown, it doesn't respond to keyboard pressing 'S', 'N' or 'Y'. always the user needs to click the button.


How can we achieve to able the shown MessageBoxAdv DialogBox to respond to keypressing?


Thank in advance.



KS Kayalvizhi Sivashanmugam Syncfusion Team August 24, 2022 04:39 AM UTC

Hi Herney,


While we localize MessageBoxAdv we can achieve HotKey support by using '&' symbol before the text. Any character that has '&' symbol preceding it is considered as a hotkey. For Example, the character "S" is considered as a shortcut key when the text is &SI.

Code Snippets:

case ResourceIdentifiers.Yes:

return "&SI";
case ResourceIdentifiers.No:

return "&NO";


Regards,

Kayalvizhi S



HE Herney Eduardo Duque A August 24, 2022 08:34 PM UTC

No more words to say.


Every day I likemuch  Syncfusion. 



KS Kayalvizhi Sivashanmugam Syncfusion Team August 25, 2022 12:21 PM UTC

Hi Herney,


We are glad to know that your issue has been fixed. Please let us know if you need any other assistance. We will be happy to assist you.


Regards,

Kayalvizhi S


Loader.
Live Chat Icon For mobile
Up arrow icon