<legend id='8hISR'><style id='8hISR'><dir id='8hISR'><q id='8hISR'></q></dir></style></legend>
      <tfoot id='8hISR'></tfoot>

      <small id='8hISR'></small><noframes id='8hISR'>

      • <bdo id='8hISR'></bdo><ul id='8hISR'></ul>

      <i id='8hISR'><tr id='8hISR'><dt id='8hISR'><q id='8hISR'><span id='8hISR'><b id='8hISR'><form id='8hISR'><ins id='8hISR'></ins><ul id='8hISR'></ul><sub id='8hISR'></sub></form><legend id='8hISR'></legend><bdo id='8hISR'><pre id='8hISR'><center id='8hISR'></center></pre></bdo></b><th id='8hISR'></th></span></q></dt></tr></i><div id='8hISR'><tfoot id='8hISR'></tfoot><dl id='8hISR'><fieldset id='8hISR'></fieldset></dl></div>

      1. c# 从我的自定义应用拖放到记事本

        时间:2023-08-25
        • <bdo id='v88Np'></bdo><ul id='v88Np'></ul>
          <legend id='v88Np'><style id='v88Np'><dir id='v88Np'><q id='v88Np'></q></dir></style></legend>

            <tfoot id='v88Np'></tfoot>
              <tbody id='v88Np'></tbody>
              <i id='v88Np'><tr id='v88Np'><dt id='v88Np'><q id='v88Np'><span id='v88Np'><b id='v88Np'><form id='v88Np'><ins id='v88Np'></ins><ul id='v88Np'></ul><sub id='v88Np'></sub></form><legend id='v88Np'></legend><bdo id='v88Np'><pre id='v88Np'><center id='v88Np'></center></pre></bdo></b><th id='v88Np'></th></span></q></dt></tr></i><div id='v88Np'><tfoot id='v88Np'></tfoot><dl id='v88Np'><fieldset id='v88Np'></fieldset></dl></div>

                • <small id='v88Np'></small><noframes id='v88Np'>

                  本文介绍了c# 从我的自定义应用拖放到记事本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个需要支持拖放的自定义应用程序.在我的应用程序中拖动网格时,在其 DoDragDrop 方法中,我提供了要以序列化格式放置的对象.

                  I have a custom app which needs to support Drag and Drop. On Dragging the grid in my app, in its DoDragDrop method I have provided the object to be dropped in a serialized format.

                  当拖放到我的一个应用程序时,它能够使字符串脱轨并创建对象.

                  When the drop is to one of my apps, it is able to deserailize the string and create the object.

                  我想要做的是让源应用程序也能够放入 NotePad/TextPad.我可以看到我可以将文件从 Windows 资源管理器拖放到记事本,但无法将纯文本拖放到记事本.猜猜它会检查 DragEnter 事件中的 DataFormat 并禁止字符串,但允许将文件放入其中.

                  What I want to do is allow the source app to be able to drop into NotePad/TextPad as well. I can see that I can drag and drop files from windows explorer to Notepad , but am not able to drag and drop plain text to NotePad. Guess it checks the DataFormat in the DragEnter event and dis-allows strings but allows files to be dropped into it.

                  • 有没有办法在源应用程序中更改 yr 格式,以便它提供临时文件/字符串.
                  • 是否可以提供 2 种格式的数据,以便目标 drop 可以接受它喜欢的任何格式?

                  提前致谢!

                  推荐答案

                  您可以将多种格式的数据添加到传递给 DoDragDrop 调用的 DataObject 中,因此只需添加另一个对 SetData 的调用以添加新格式.这是最合适的实现,这样 Drop 目标可以查询可用格式并选择它最喜欢的格式.

                  You can add multiple formats of your data to the DataObject you pass into the DoDragDrop call, so just add another call to SetData to add the new formats. This is the most appropriate implementation, this way the Drop target can query for available formats and choose the one it likes best.

                   DataObject d = new DataObject();
                   d.SetData(DataFormats.Serializable, myObject);
                   d.SetData(DataFormats.Text, myObject.ToString());
                   myForm.DoDragDrop(d, DragDropEffects.Copy);
                  

                  这篇关于c# 从我的自定义应用拖放到记事本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:ListBox MultiSelect 拖放问题 下一篇:将文件拖到桌面快捷方式 - 不在应用程序中打开

                  相关文章

                  最新文章

                    <i id='aBXV9'><tr id='aBXV9'><dt id='aBXV9'><q id='aBXV9'><span id='aBXV9'><b id='aBXV9'><form id='aBXV9'><ins id='aBXV9'></ins><ul id='aBXV9'></ul><sub id='aBXV9'></sub></form><legend id='aBXV9'></legend><bdo id='aBXV9'><pre id='aBXV9'><center id='aBXV9'></center></pre></bdo></b><th id='aBXV9'></th></span></q></dt></tr></i><div id='aBXV9'><tfoot id='aBXV9'></tfoot><dl id='aBXV9'><fieldset id='aBXV9'></fieldset></dl></div>
                  1. <small id='aBXV9'></small><noframes id='aBXV9'>

                    <legend id='aBXV9'><style id='aBXV9'><dir id='aBXV9'><q id='aBXV9'></q></dir></style></legend>

                    • <bdo id='aBXV9'></bdo><ul id='aBXV9'></ul>
                      <tfoot id='aBXV9'></tfoot>