GridControl表格自定义按钮设置按钮图片
替换前:
替换后:
C# 全选
DevStyle.SetGridButtonImage(gcDetail, "Add", Globals.LoadImage("24_detail_import_order.png"));
C# 全选
/// <summary>
/// 设置表格按钮的图片
/// </summary>
/// <param name="grid"></param>
/// <param name="buttonTag"></param>
/// <param name="image"></param>
public static void SetGridButtonImage(GridControl grid, string buttonTag, Image image)
{
var btn = GetButtonByTag(grid.EmbeddedNavigator.Buttons, buttonTag);
if (btn != null)
{
if (grid.EmbeddedNavigator.Buttons.ImageList is ImageList imglist)
{
imglist.Images[btn.ImageIndex] = image;
}
}
}
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网