string fldr = ConfigurationSettings.AppSettings["IMGFOLDER"]; formload() { PopulateTreeview(); } BtnImageShow() { DisplayImage(); } private void POpulateTreeview() { DirectoryInfo info = new DirectoryInfo(fldr); TreeNode root = new TreeNode(info.Name); root.Text = ""; TreeNode node = new TreeNode(); TrvImageFile.Nodes.Add(root); FileInfo[] subfileinfo = info.GetFiles("*.*"); if (subfileinfo.Length > 0) { for ( j = 0; j < subfileinfo.Length; j++) { root.Nodes.Add(subfileinfo[j].Name); } } TrvImageFile.ExpandAll(); } DisplayImage() { fldr = string.Concat(fldr, "\\"); fpath = string.Concat(fldr, TrvImageFile.SelectedNode.Text); try { rasterImageViewer1.Image = rc.Load(fpath); } catch (Exception ex) { MessageBox.Show("nothing to select there "); MessageBox.Show(ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)