• DotNetBar MessageBoxEx 显示中文 显示office2007风格


    MessageBoxEx显示消息的时候按钮是中文的解决这个问题设置 MessageBoxEx的UseSystemLocalizedString属性为 true。

    MessageBoxEx.UseSystemLocalizedString = true;
    

    在Program里面写下面代码

      static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                LocalizationKeys.LocalizeString += LocalizationKeys_LocalizeString;
                Application.Run(new FormMain());
            }
            static void LocalizationKeys_LocalizeString(object sender, LocalizeEventArgs e)
            {
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxCancelButton)
                {
                    e.LocalizedValue = "取消";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxNoButton)
                {
                    e.LocalizedValue = "取消";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxOkButton)
                {
                    e.LocalizedValue = "确定";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxYesButton)
                {
                    e.LocalizedValue = "确定";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MonthCalendarClearButtonText)
                {
                    e.LocalizedValue = "清除";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MonthCalendarTodayButtonText)
                {
                    e.LocalizedValue = "今天";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorHourLabel)
                {
                    e.LocalizedValue = "";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorMinuteLabel)
                {
                    e.LocalizedValue = "";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorClearButton)
                {
                    e.LocalizedValue = "清除";
                    e.Handled = true;
                }
                if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorOkButton)
                {
                    e.LocalizedValue = "确定";
                    e.Handled = true;
                }
            }

    在Win7下当窗体继承Office2007Form后还是显示的不是office2007风格把主窗体的EnableGlass属性设置为False

    如果MessageBoxEx显示的风格不是office2007Form把 MessageBoxEx的EnableGlass属性设置为False

  • 相关阅读:
    第四节:前端自动化准备和详细配置(NVM、NPM/CNPM、NodeJs、NRM、WebPack、Gulp/Grunt、Git/SVN)
    第二十三节: EF性能篇(三)之基于开源组件 Z.EntityFrameWork.Plus.EF6解决EF性能问题
    第三节:一些指令总结(Nuget、)
    第十七节:易混淆的概念(静态和非静态、拆箱和装箱)
    Java使用Log4记录日志
    Java读取xml
    C# int.ToString() 常用参数说明
    WebAPI获取客户端请求数据
    Zend Studio获取永久使用权
    template.js 模版内调用外部JS方法
  • 原文地址:https://www.cnblogs.com/junjie94wan/p/3201028.html
Copyright © 2020-2023  润新知