添加后如何从树视图中删除图像

发布于 2024-11-25 17:02:13 字数 229 浏览 2 评论 0原文

使用 Visual Studio 2010 和 C#,我有一个树视图,并向每个节点添加了图像。回想起来,我现在想要删除与 3 个主根节点的子节点关联的图像。如何从 3 个主根节点的子节点中删除图像,但将图像保留在 3 个根节点上?

我尝试打开节点的属性,并将所有子节点的 ImageIndex 和 SelectedImageIndex 更改为“none”,当我按“确定”时,它仍然显示每个子节点的默认图像。

谢谢

Using visual studios 2010 and c# i have a treeview and i added images to each of the nodes. In retrospect i now want to remove the images that are associated with the children of the 3 main root nodes. How do i remove the images from the children of my 3 main root nodes but keep the images on the 3 root nodes?

I have tried opening the properties for the nodes and changed the ImageIndex and SelectedImageIndex to "none" for all of the children nodes and when i press ok, it still shows the default image for each child node.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的呼吸 2024-12-02 17:02:13

我不确定,但我相信您可以通过 TreeView 中的每个控件在 [TreeView].Controls... 中执行 foreach... 在那里您可以搜索 [control].GetType() == typeof( [type_of_the_image]),并执行一些逻辑以获取主要图像。

除此之外,您可以通过 jQuery 删除,执行类似于我上面所说的操作。如果您对这些想法感兴趣,我可以帮助您开发。

I'm not sure of it, but I believe that you can pass through every control inside the TreeView doing a foreach in [TreeView].Controls... In there you can search for [control].GetType() == typeof([type_of_the_image]), and do some logic to get just the main ones.

Besides that, you can remove by jQuery, doing something close to what I said above. If these ideas are something that interests you, I can help with the development.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文