How to serialize a TreeView  
Author Message
Joseph Stalin





PostPosted: Visual Basic Express Edition, How to serialize a TreeView Top

I'm using a TreeView Component for my Favourites list in a web browser i'm making and i want to save the nodes(TreeView nodes) into a xml file in such a way as i can load it back up when the program loads next
the following code is the problem, i dont know how to make my xmlwriter write the nodes into the document, can anybody help



Dim writer As New XmlSerializer(GetType(TreeViewAction))
Dim file As New StreamWriter("C:\Program Files\Moose Inc\DHWB\Bookmarks\Bookmarks.xml")
writer.Serialize(file, TreeView1.Nodes)
file.Close()



(PS. i Apoligise for the double posting of this, but i need the answer as quick as posible and the other topic went cold)



Visual Studio Express Editions36  
 
 
ahmedilyas





PostPosted: Visual Basic Express Edition, How to serialize a TreeView Top

Take a look at this:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=137052&SiteID=1



 
 
Joseph Stalin





PostPosted: Visual Basic Express Edition, How to serialize a TreeView Top

Already read that, and i'm looking for an answer in VB 2005


 
 
ahmedilyas





PostPosted: Visual Basic Express Edition, How to serialize a TreeView Top

how about this:

http://www.codeproject.com/vb/net/TreeViewDataAccess.asp



 
 
Tall Dude





PostPosted: Visual Basic Express Edition, How to serialize a TreeView Top

I think you might be able to do this with settings.

(Save the whole treeview info.)

You can browse in the 'settings' 'type' and find things

such as System.Windows.Forms.TreeView etc.

I'm just not sure how to setup an initial value to nothing

and bind the setting. I just think it can be done.