【发布时间】:2012-01-31 02:46:59
【问题描述】:
我在 C# winforms 项目中使用 ObjectListView,并希望在其中一列中显示一个小图标。
到目前为止,图标显示得很好,但它没有在列中居中,而且我找不到任何与列中的图像对齐有关的文档或代码。
Here are the instructions for displaying an image as the column contents.
代码与给出的示例几乎相同:
col_Important.AspectGetter = delegate(object x) { return ((ClassMyItem)x).IsImportant; };
col_Important.AspectToStringConverter = delegate(object x) { return String.Empty; };
col_Important.ImageGetter = delegate(object x)
{
return ((ClassMyItem)x).IsImportant? "star" : "none";
};
有没有人处理过这个问题并且知道如何使图像居中?
【问题讨论】:
标签: .net winforms objectlistview