This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Can the standard error provider (icon) be used on Treeview nodes?
I have one parent node with one child, I want to show the icon next to the parent only and remove the + and - images .
Working with VB .NET, but can use a C# example. Thanks much!
Thanks for your reply.
Ok, so here is what seems to work. I got the icon from here. I did a target save picture as... on the red provider icon.
http://msdn.microsoft.com/en-us/library/a0d996e0.aspx
Here is some sample code. I put the IC27018.gif in the resources folder.
Dim TVNode As TreeNode TVNode = TreeView1.Nodes.Add("First Names") TVNode.Nodes.Add("Mike") TVNode.Nodes.Add("Bill") TVNode.Nodes.Add("John") TVNode.Nodes.Add("Pete") Dim myImageList As New ImageList() myImageList.Images.Add(My.Resources.IC27018) TreeView1.ImageList = myImageList TreeView1.ImageIndex = 0 TreeView1.SelectedImageIndex = 0 TreeView1.ExpandAll()
No, the TreeView does not support ErrorProvider on the individual TreeNodes.
Consider some scheme where you change the image for the TreeNode yourself and provide a tooltip, etc. on the TreeNode with the error message.