【发布时间】:2019-05-03 02:43:58
【问题描述】:
我在 windows 窗体中有带有三个视图节点的树视图
我想知道是否可以将文本与图像连接起来。我是说
注意:图片当前存储在
ImageList
This is a node (image here)
Another node (image here)
我尝试做类似的事情:
nodes[idx].Text = nodes[idx].Text + nodes[idx].ImageIndex;
但它只是做这样的事情:
This is a node 10
Another node 10
而不是使用图像,它使用当前图像索引值。
有没有可能实现我想要的?
【问题讨论】:
-
所以你想连接字符串和字节?
-
我不知道 ImageCollection 是否返回字节,但我再次尝试:
nodes[idx].Text = nodes[idx].Text + imgList.Images[1];并返回This is a node System.Drawing.Bitmap@HastaTamang -
您正带着这个要求进入 OwnerDraw 和 DrawNode 世界。
-
对使用标准功能有什么反感 - docs.microsoft.com/en-us/dotnet/framework/winforms/controls/… - 图标在左侧是个大问题吗?
-
我想在文本旁边创建类似“标签”的内容,因此根据收到的值设置标签,例如“已审核”-“已完成”等。@CaiusJard