471,602 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,602 software developers and data experts.

Clipboard to copy Treenode

I am using the clipboard to copy and paste a TreeNode but the Tag property
does not seem to be copied.
I use the Tag property for an Object that contains data relating to the
TreeNode. The Tag property is fine when the TreeNode is put onto the
Clipboard but the Tag property is always 'nothing' when I take the TreeNode
from the Clipboard.

Private Sub PutNodeOnClipboard(ByVal thisNode As TreeNode)
Dim thisDataObject As New DataObject
thisDataObject.SetData(myFormat.Name, thisNode)
Clipboard.SetDataObject(thisDataObject)
End Sub

Private Sub MIEdit_Paste_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MIEdit_Paste.Click
Dim myClipData As IDataObject = Clipboard.GetDataObject()
If myClipData.GetDataPresent(myFormat.Name) Then
Dim NodeFromClip As TreeNode = _
CType(myClipData.GetData(myFormat.Name, True), TreeNode)
....
This last line of code takes the TreeNode from the clipboard and all the
properties seem fine except the Tag property.
What do I need to do to ensure the Tag property follows the TreeNode via
Clipboard.

Thanks
Fred

Nov 21 '05 #1
0 1726

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Christopher | last post: by
7 posts views Thread by lgbjr | last post: by
9 posts views Thread by Alan T | last post: by
2 posts views Thread by toronto | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.