Adding nodes dynamically ???
I have an application which timely create log file in XML format
I ma using the SystemFileWatcher object to monitor creation of new file in the proper path. So far no problem
When the first file is created, my SystemFile onchanged event is catch and then I add the new log file in a treview control with the following code:
Dim m_Root As New TreeNode
m_Root = Me.tLogView.Nodes.Item(0)
'For idx = 0 To sFile.Count - 1
Dim m_Node As New TreeNode(e.Name, 2, 2)
When the second file is created, event is cacthed again, and I am suppose to add the new file to the treeview as previous step. But at that time I have an exception which says something like I am not in the current thread and I need to call Control.Invoke before adding my new node ???
What sors it means ? how can add new nodes when Onchange event occurs?
thaks for your help