- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道如何在 ListView 子项中添加图像。
我正在使用此代码在子项中显示文本。
double Text = "2452";
ListViewItem lItem = new ListViewItem();
lItem.SubItems.Add(Text.ToString());
我想做这样的事情
ListViewItem lItem = new ListViewItem();
lItem.SubItems.Add(Text.ToString() + "C:\\image.png");
提前致谢。
最佳答案
private void ListView1_DrawColumnHeader(object sender, System.Windows.Forms.DrawListViewColumnHeaderEventArgs e) {
e.DrawDefault = true;
}
private void ListView1_DrawSubItem(object sender, System.Windows.Forms.DrawListViewSubItemEventArgs e) {
if (!(e.Item.SubItems(0) == e.SubItem)) {
e.DrawDefault = false;
e.DrawBackground();
e.Graphics.DrawImage(My.Resources.Image1, e.SubItem.Bounds.Location);
e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font, new SolidBrush(e.SubItem.ForeColor), (e.SubItem.Bounds.Location.X + My.Resources.Image1.Width), e.SubItem.Bounds.Location.Y);
}
else {
e.DrawDefault = true;
}
}
关于c# - 如何在 listview.subitem 中添加图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7997348/
sidebarMenu 中的 MenuItem 有问题。当我添加第三个 MenuItem (RFM) 时,它似乎在 ui 中呈现为子项,当我单击该项目时,即使在服务器中也没有显示任何内容。R 有相应的
在我的项目中,我想要一个表,其中的项目可能有子项目,就像在 Eclipse 的“问题” View 中一样。 (索引2-17应该是1的子项) 到目前为止我的项目: Overview of my Proj
我需要在发布弹出窗口中隐藏“发布子项目”吗?由于我的内容层次结构中有大量内容(超过 100 万),因此尝试发布带有子项目的项目将行不通。 最佳答案 您可以覆盖 sitecore\shell\Appli
我尝试使用 CSS 为 Wordpress 模板创建下拉菜单。当我将鼠标悬停在菜单项上时(例如,您可以在图片上看到的“Cupcake Ipsum”),整个菜单以一种奇怪的方式显示。 我希望这张图片是不
我想知道如何在 ListView 子项中添加图像。 我正在使用此代码在子项中显示文本。 double Text = "2452"; ListViewItem lItem = new ListVie
我生成了一个 Excel 表,其中包含格式如下的数据: IOW、“总包”、“总购买”、“平均价格”和“总百分比”值位于它们自己的列(数据)中,用于每个总体(或侧面)描述。 当我对这些数据进行数据透视表
我正在使用 Grails 1.1 和导航插件 1.0.4,但刚刚遇到了一个问题。我希望将来自 3 个不同 Controller 的操作作为子项贡献给来自不同 Controller 的菜单。 我看到的所
我有一个带有子项目菜单的选项菜单 当我单击选项菜单时,我的应用程序崩溃,但无法解密日志 我想要一个选项按钮来打开 3 个选项菜单子(monad)项 我检查了一些教程,但我看不出我错在哪里
是否可以将 ListView 中的项目显示为一种颜色,而将其子项目显示为另一种颜色? 我正在创建一个游戏(乘法表问答游戏),其中用户给出的问题和答案以及正确答案都被转移到 ListView 中。例如:
我需要重现我们可以在 forbes.com 上找到的那种菜单。我只对 Logo 项子菜单感兴趣。我就快完成了。我制作了 Logo 元素菜单,带有类别名称的第一级菜单和显示每个类别的文章链接的第二级菜单
我正在尝试将两个列添加到 ListView 中,一个用于某些内容,一个用于其他内容,但它不会让我选择子项目,只有原始项目是否可以在不使用整行选择的情况下解决这个问题?我还必须能够从 txt 文件加载项
我在任何地方都找不到将子项目添加到我的可扩展列表的说明。我只能找到 50 个关于如何更改背景颜色的问题。 现在,我正在使用这段代码来创建一个普通的 ListView : public String
我在详细信息模式下使用 WinForms ListView(.NET 4.0,在 Windows 7 上运行)并且我有一个函数需要清除特定项目中的子项目。不幸的是,当我这样做时,它也清楚了名字: it
我希望左侧导航栏中的子项始终展开,请参见此处: http://i.imgur.com/lScAPXf.png 但即使我点击箭头,当时也只有一项展开。单击不同的箭头时,打开的元素将关闭。由于我的菜单非常
我有一个包含 2 列的 ListView ,当我双击一个项目时,我需要在 TextBox 控件中显示其相应子项目的值。我该怎么做? 我搜索了 Google,但没有返回任何有用的信息,可能是因为我不确定
如果您在运行时在现有列之间添加新列,则子项索引不会像我想象的那样。 例如在第二列和第三列之间添加新列后,列/子项如下所示: colums[0] | colums[1] | (new) colu
如果您将ownerdraw与TListView一起使用,则对于自定义绘制的子项之后的所有子项,即使listview font.style设置为[],子项默认情况下都是粗体字体样式。 我发现的解决方法是
我正在构建一个下拉菜单。问题是,在 IE9 中,子绝对定位元素的背景仅在父元素内可见。您可以在其中看到菜单的页面:http://darkstar.weblunatix.net/stan/ddmenu
当我尝试从我的 wordpress API 中提取图像 source_URL 时,我得到 TypeError: Undefined is not an object (evaluating 'subi
我是一名优秀的程序员,十分优秀!