在 TreeNode 中嵌入图像 [英] Embed an image in a TreeNode

查看:32
本文介绍了在 TreeNode 中嵌入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将全尺寸图像嵌入到 TreeNode 中?

How to embed a full-size image to a TreeNode?

目标是显示详细的日志文件,其中每个节点代表窗口标题,其子节点包含键盘日志.

The goal is to display detailed log file, where each node represents window caption and its subnodes contain keylog.

推荐答案

使用以下模式将图像添加到 TreeView 图像列表.

Use the following pattern to add images to the TreeView image list.

ImageList treeList = new ImageList();
treeList.Images.Add("imageKey", myImage);

然后将图像设置为节点使用

Then to set an image to a node use

myNode.ImageKey = "imageKey";

这篇关于在 TreeNode 中嵌入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆