Torna al Thread

try { string path = Application.StartupPath.Substring(0, Application.StartupPath.IndexOf("\\bin")); il.Images.Add(new Icon(path + "\\Image\\image1.ico")); il.Images.Add(new Icon(path + "\\Image\\image2.ico")); il.Images.Add(new Icon(path + "\\Image\\image3.ico")); System.Drawing.Image myImage = Image.FromFile(path + "\\Image\\image4.gif"); il.Images.Add(myImage); } catch (FileNotFoundException ex) { MessageBox.Show(ex.Message, "Attenzione"); } catch (ArgumentOutOfRangeException arg) { MessageBox.Show(arg.Message, "Attenzione"); } tv_Main.ImageList = il; for (int iCount = 0; iCount < tv_Main.Nodes.Count; iCount++) { if (tv_Main.Nodes[iCount].Text.ToUpper().Contains(str.ToUpper())) { tv_Main.SelectedNode = tv_Main.Nodes[iCount]; tv_Main.Select(); tv_Main.Nodes[iCount].ImageIndex = 1; tv_Main.Nodes[iCount].SelectedImageIndex = 1; } else { tv_Main.SelectedNode = tv_Main.Nodes[iCount]; tv_Main.Select(); tv_Main.Nodes[iCount].ImageIndex = -1; tv_Main.Nodes[iCount].SelectedImageIndex = -1; } }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5