zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    mysql 查询缓存
    DevExpress 使用示例
    搜索营销推广学习资料
    mysql 导出表结构
    Google nexus one 获取root权限
    ASP.NET 使用Get方式请求WebService,并得到DataSet结果
    Iweboffice 2009 Winform版 Word文件的打开与保存
    【转】mysql 分析查找执行效率慢的SQL语句
    java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction
    java 中job的core配置
  • 原文地址:https://www.cnblogs.com/junjie94wan/p/3201028.html
Copyright © 2011-2022 走看看