摘自:http://www.componentcn.com/html/kjjs_197_7681.html
DotNetBar很多子控件的系统文本、提示信息等都是可以本地化的,可以转化为多种语言,控件提供 DotNetBarManager.LocalizeString事件来进行每个控件的系统文本汉化。如果是想进行全局汉化所有DotNetBar 控件,则可以使用 LocalizationKeys.LocalizeString 事件来进行汉化,如对MessageBoxEx控件进行汉化。
具体请看下面的代码:
全局汉化:
[STAThread]
static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
 
    DevComponents.DotNetBar.LocalizationKeys.LocalizeString += new 
DevComponents.DotNetBar.DotNetBarManager.LocalizeStringEventHandler(LocalizeString);
 
    Application.Run(new Form1());
}
 
static void LocalizeString(object sender, DevComponents.DotNetBar.LocalizeEventArgs e)
{
     if (e.Key == LocalizationKeys.MessageBoxYesButton)//汉化MessageBoxEx控件中的Yes按钮
            {
                e.LocalizedValue = "是";
                e.Handled = true;
            }
}
当然LocalizationKeys类,里面枚举了很多控件的系统文本,都可以一一进行汉化,具体操作就跟上面一样。
具体某个控件汉化,很多DotNetBar控件都提供了LocalizeString事件,可以在该事件里对该控件的系统文本进行汉化:如navigationPane中系统文本"show more buttons"的汉化:
private void navigationPane1_LocalizeString(object sender, LocalizeEventArgs e)
        {
            if (e.Key == LocalizationKeys.NavBarShowMoreButtons)
            {
                e.LocalizedValue = "显示更多按钮";
                e.Handled = true;
            }
        } 
其他控件的汉化都跟上面的模式一样,这里就不一一介绍了。