【问题标题】:How to localize DotNetBar DatePicker?如何本地化 DotNetBar DatePicker?
【发布时间】:2015-09-15 07:02:33
【问题描述】:

如何本地化DotNetBar 的DatePicker 组件以显示本地化日历?

即使更改输入语言,它仍然显示英文日历。 解决办法是什么?

【问题讨论】:

    标签: c#-4.0 datepicker dotnetbar


    【解决方案1】:

    您只需要为 LocalizationKeys.LocalizeString 静态事件添加处理程序。

    下面是一个本地化 DateTimeInput 控件文本的示例。

    在您的静态 void Main() 方法中,

    DevComponents.DotNetBar.LocalizationKeys.LocalizeString += new DotNetBarManager.LocalizeStringEventHandler(LocalizeString);
    
    private static void LocalizeString(object sender, LocalizeEventArgs e)
        {
            if (e.Key == LocalizationKeys.MonthCalendarTodayButtonText)
            {
                e.LocalizedValue = Properties.Resources.MonthCalendarTodayButtonText;
            }
            if (e.Key == LocalizationKeys.MonthCalendarClearButtonText)
            {
                e.LocalizedValue = Properties.Resources.MonthCalendarClearButtonText;
            }
    
            e.Handled = true;
        }
    

    您可以在此处参考官方文档。 http://www.devcomponents.com/kb2/?p=523

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-29
      • 1970-01-01
      • 2011-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多