After adding a node dynamically to my treeview I can no longer write xml. The code I use to add the node is;
Before adding the node xml works fine. Afterward I can not write xml from any form in any manner. Completely baffled.
VB.NET:
Public Sub addVideo()
Dim openFileDialog1 As New OpenFileDialog
openFileDialog1.Filter = "Vidoe Files |*.avi;*.asf;*.mov;*.mp4;*.3gpp;*.mpg;*.mpeg;*.flv;*.swf;*.wmv;*.dv;*.ogg;*.mkv;*.rm;*.vob"
openFileDialog1.Title = "Select an input file."
If openFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim node As TreeNode() = frmProject.TreeView1.Nodes.Find("Video", True)
frmProject.TreeView1.SelectedNode = node(0)
With node(0).Nodes.Add(openFileDialog1.FileName)
.Text = openFileDialog1.SafeFileName
.Name = openFileDialog1.FileName
.Tag = "video"
.ImageIndex = 1
.SelectedImageIndex = 1
End With
openFileDialog1.Dispose()
node(0).Expand()
End If
End Sub
Before adding the node xml works fine. Afterward I can not write xml from any form in any manner. Completely baffled.