Copy TreeView Node

后端 未结 3 2082
离开以前
离开以前 2021-01-19 15:21

I am trying to copy the selected treeview node to the clip board so I can paste it in notepad. Here is my code but it doesn\'t work.

    TreeNode selNode = (         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-19 15:59

    If you want other programs to recognise what's on the clipboard, you need to use a recognised data format (e.g. plain text, or bitmap) string parameter, and to format the tree node into that format (e.g. if you choose text, you should pass a 'string' as the clipboard data, perhaps the TreeNode.Text value). See System.Windows.Forms.DataFormats for the different predefined types.

提交回复
热议问题