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

  • 相关阅读:
    蓝牙基础学习
    树莓派识别TF卡内存错误导致内存可用减小解决方法
    有谁知道openwrt的系统的编译,烧录原理不吝赐教!
    树莓派显示屏输出设置
    树莓派连接摄像头做wifi视频
    Python3 安装PyUserInput从而实现鼠标点击事件
    树莓派ssh连接并使用sftp协议拷贝文件到电脑
    python tkinter 中 listbox绑定scrollbar实现自动循环滚动
    Python Tkinter学习
    代理模式
  • 原文地址:https://www.cnblogs.com/junjie94wan/p/3201028.html
Copyright © 2011-2022 走看看