CSFrameworkV6:Toolbar功能按钮的子按钮设置多语言
CSFrameworkV6:Toolbar功能按钮的子按钮设置多语言
目录
DevBarListButton 类 AddSubButton 修复Bug
C# 全选
public void AddSubButton(IButtonInfo button)
{
_btn.ItemLinks.Add(button.Button as BarButtonItem);
_SubButtons.Add(button);
}
CSFrameworkV6.Library.Extensions.DevExpressExtensions 添加一个扩展方法
C# 全选
/// <summary>
/// 查找子按钮
/// </summary>
/// <param name="owner"></param>
/// <param name="name"></param>
/// <returns></returns>
public static IButtonInfo FindSubitem(this IButtonInfo owner, string name)
{
NullButton result = new NullButton();
if (owner.SubButtons == null || owner.SubButtons.Count == 0)
return result;
var btn = owner.SubButtons.Where(w => w.Name.ToUpper() == name.ToUpper()).FirstOrDefault();
return btn == null ? result : btn;
}
重写窗体的 SetLanguage 方法
C# 全选
public override void SetLanguage()
{
base.SetLanguage();
var btnOwner = _buttons.GetButtonByName(ButtonNameList.btnExportDataDict);
btnOwner.FindSubitem("btnExportFile").Caption = LanLib.Get("导出模版文件");
btnOwner.FindSubitem("btnImportFile").Caption = LanLib.Get("导入模版数据");
}
效果
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网