【问题标题】:C# ObjectListView Button with icon?C# ObjectListView 带有图标的按钮?
【发布时间】:2016-09-28 19:05:30
【问题描述】:

我正在使用 ObjectListView!太棒了!我有一个OLV使用细节问题,item栏是Button!如何设置按钮图标?我很抱歉写错了:)

【问题讨论】:

  • 是设置按钮的图标示例删除图标或编辑图标

标签: c# winforms objectlistview


【解决方案1】:

假设! ObjectListView 中有一个名为 olvButton 的列。您只需要在初始化ObjectListView 时创建一个ImageGetter 委托并返回Image。

private void InitializeObjectListView()
{
    //Other settings for ObjectListView
    this.ObjectLV.RowHeight = 40;
    this.ObjectLV.EmptyListMsg = "No item found";

    //Set Image index for Button Column
    this.olvButton.ImageGetter = delegate(object x)
    {
        //ImageList is a control in which I have added one Image.
        return imagesList.Images[0];
    };
}

欲了解更多信息Have a look at this

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-19
    • 1970-01-01
    • 1970-01-01
    • 2015-12-23
    相关资源
    最近更新 更多