简体   繁体   English

如何开始在不同进程之间实现拖放?

[英]How to start to implement a drag and drop between different processes?

The application that I am developing is a windows form application written in C#. 我正在开发的应用程序是用C#编写的Windows窗体应用程序。 It has a treeview on it. 它上面有一个树状视图。 Each of the treeNode stores some data. 每个treeNode存储一些数据。 What I want to do is to open two copies of the application, drag some of the treenodes from one application and drop to another. 我想要做的是打开应用程序的两个副本,将一个树节点从一个应用程序拖放到另一个应用程序。 The data the treenodes store should be transferred to another application to build treenodes on another application. treenodes存储的数据应转移到另一个应用程序,以在另一个应用程序上构建treenodes。 I wonder how to implement the drag and drop functionality like this? 我想知道如何实现这样的拖放功能吗? Thanks for your help. 谢谢你的帮助。

I think if you mark your types as [Serializable] AND implement custom serialization, it should work. 我认为,如果您将类型标记为[可序列化]并实现自定义序列化,则应该可以使用。 Otherwise, you can serialize them yourself to a MemoryStream and then add that MemoryStream to the data object using any custom data format. 否则,您可以自己将它们序列化为MemoryStream,然后使用任何自定义数据格式将该MemoryStream添加到数据对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM