Learn how to a build a cloud-first strategyRegister Now


List Of TreeNode in Clipboard ?

Posted on 2012-08-17
Medium Priority
Last Modified: 2012-08-17
Hello EE,

I have a list(Of TreeNode) when the user press CTRL+C i would like to put all the Selectednodes of a Treeview in the ClipBoard

then if CTRL+V I would like to retrieve them

can you help? Im having difficulties
Question by:PhilippeRenaud
  • 2
LVL 86

Accepted Solution

Mike Tomlinson earned 2000 total points
ID: 38305138
Here's a quick example:
        Dim DataNameConstant As String = "MyTreeNodeList"

        Dim nodes As New List(Of TreeNode)
        nodes.Add(New TreeNode("a"))
        nodes.Add(New TreeNode("b"))
        nodes.Add(New TreeNode("c"))

        Clipboard.SetData(DataNameConstant, nodes)
        nodes = Nothing

        nodes = DirectCast(Clipboard.GetData(DataNameConstant), List(Of TreeNode))
        For Each node As TreeNode In nodes

Open in new window

LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38305749
Idle_Mind's solution is certainly what you should be doing--so long as you understand that you are going to be pasting the binary-serialized version of the List. It's not going to simply paste into Notepad as a list of items. If you want to paste this data into, say, a text editor, then you will need to format the data with newlines and place it into the clipboard as a string.
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 38305781
Yeah...as I posted that I was wondering how the copy/paste is going to be utilized in the end product.

Author Comment

ID: 38305857
Yup, I understand. Thanks!

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question