C# TreeView NodeDoubleClick Problem
I have the following code in C#. When I double click my files I need to search the txt file and display certain information in the next box beside the label. however I am unable to display my split text into the textbox. any suggestions? 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private Field f;
        public Form1()
        {
            InitializeComponent();
        }

        private void populateTree(string path, TreeNode tv1)
        {
            string[] dir = Directory.GetDirectories(path);
            foreach (string d in dir)
            {
                string entry = Path.GetFileName(d);
                TreeNode t = tv1.Nodes.Add("Folder", entry, 0);
                populateTree(d, t);
            }
            string[] files = Directory.GetFiles(path);
            foreach (string f in files)
            {
                string entry = Path.GetFileName(f);
                tv1.Nodes.Add(f, entry, 1);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //populate the tree
            TreeNode t = treeView1.Nodes.Add("Units");
            populateTree(@"..\units\", t);

            f = new Field();
            f.label = new Label();
            f.label.AutoSize = true;
            f.label.Location = new System.Drawing.Point(323, 9);
            f.label.Name = "Programtittle";
            f.label.Text = "UAI UnitDef Editor";
            this.Controls.Add(f.label);

            int clabel = 36;
            f.varName = new string[] { "unitName", "name", "description" }; //define labels

            //popluate label
            for (int i = 0; i < f.varName.Length; i++)
            {
                f.label = new Label();
                f.label.AutoSize = true;
                f.label.Location = new System.Drawing.Point(323, clabel);
                f.label.Name = "label";
                this.Controls.Add(f.label);
                f.label.Text = f.varName[i];
                clabel = clabel + 26;
            }

            //populate textbox 
            int cbox = 33;
            for (int i = 0; i < f.varName.Length; i++) 
            {

                f.txtBox = new TextBox();
                f.txtBox.Location = new System.Drawing.Point(380, cbox);
                f.txtBox.Name = "txtBox";
                f.txtBox.Size = new System.Drawing.Size(100, 50);
                this.Controls.Add(f.txtBox);

                cbox = cbox + 26;
            }
        }

        private void populateLabelTxtBox(string path)
        {
            //f.txtBox.Multiline = true; //added for testing purpose; 

            //read,split file 
            string text = System.IO.File.ReadAllText(path);
            
            char[] delimiters = new char[] { '{', '=', ';', '}' };
            string[] parts = text.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
        }

        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (treeView1.SelectedNode.Name != "Folder")
            {
                //f.txtBox.Text = treeView1.SelectedNode.Name;
                populateLabelTxtBox(treeView1.SelectedNode.Name);
                
            }
        }
    }
}

C# TreeView NodeDoubleClick Problem
===

I have the following code in C#. When I double click my files I need to search the txt file and display certain information in the next box beside the label. however I am unable to display my split text into the textbox. any suggestions? 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private Field f;
        public Form1()
        {
            InitializeComponent();
        }

        private void populateTree(string path, TreeNode tv1)
        {
            string[] dir = Directory.GetDirectories(path);
            foreach (string d in dir)
            {
                string entry = Path.GetFileName(d);
                TreeNode t = tv1.Nodes.Add("Folder", entry, 0);
                populateTree(d, t);
            }
            string[] files = Directory.GetFiles(path);
            foreach (string f in files)
            {
                string entry = Path.GetFileName(f);
                tv1.Nodes.Add(f, entry, 1);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //populate the tree
            TreeNode t = treeView1.Nodes.Add("Units");
            populateTree(@"..\units\", t);

            f = new Field();
            f.label = new Label();
            f.label.AutoSize = true;
            f.label.Location = new System.Drawing.Point(323, 9);
            f.label.Name = "Programtittle";
            f.label.Text = "UAI UnitDef Editor";
            this.Controls.Add(f.label);

            int clabel = 36;
            f.varName = new string[] { "unitName", "name", "description" }; //define labels

            //popluate label
            for (int i = 0; i < f.varName.Length; i++)
            {
                f.label = new Label();
                f.label.AutoSize = true;
                f.label.Location = new System.Drawing.Point(323, clabel);
                f.label.Name = "label";
                this.Controls.Add(f.label);
                f.label.Text = f.varName[i];
                clabel = clabel + 26;
            }

            //populate textbox 
            int cbox = 33;
            for (int i = 0; i < f.varName.Length; i++) 
            {

                f.txtBox = new TextBox();
                f.txtBox.Location = new System.Drawing.Point(380, cbox);
                f.txtBox.Name = "txtBox";
                f.txtBox.Size = new System.Drawing.Size(100, 50);
                this.Controls.Add(f.txtBox);

                cbox = cbox + 26;
            }
        }

        private void populateLabelTxtBox(string path)
        {
            //f.txtBox.Multiline = true; //added for testing purpose; 

            //read,split file 
            string text = System.IO.File.ReadAllText(path);
            
            char[] delimiters = new char[] { '{', '=', ';', '}' };
            string[] parts = text.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
        }

        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (treeView1.SelectedNode.Name != "Folder")
            {
                //f.txtBox.Text = treeView1.SelectedNode.Name;
                populateLabelTxtBox(treeView1.SelectedNode.Name);
                
            }
        }
    }
}
