Hi,

Im having problems trying to update my GUI controls from a new thread i have created, i get an exception about cross threading. I have looked around and found i need to use a delegate and invoke it from the new thread, but im having problems getting this to work. Heres what ive done:

Main form:
Code:
        public delegate void UpdateFDelegate(string item);


        public void UpdateList(string item)
        {
            
            if (this.FileView.InvokeRequired)
            {
                UpdateFDelegate theDelegate = new UpdateFDelegate(this.UpdateList);
                this.Invoke(theDelegate, new object[] { item });
            }

            else
            {
                ListViewItem li = new ListViewItem();
                li.Text = "test";
                this.FileView.Items.Add(li);
            }

        }
From inside my thread class: (which inherits from the main form class)
Code:
UpdateList("test");
Now this does not throw an exception, but it dosnt work either, my debugger shows it just goes straight to the else block, i.e no invoking is done, but nothing is added to the listivew control, and ive tried adding other test code in there like changing a buttons text, but nothing on the GUI can update from it.

Any ideas what im doing wrong?

Thanks
Jack