Drag and drop from Windows File Explorer onto a Windows Form is not working

后端 未结 4 1756
一生所求
一生所求 2021-02-09 01:41

I\'m having an issue dragging a file from Windows Explorer on to a Windows Forms application.

It works fine when I drag text, but for some reason it is not recognizing

4条回答
  •  广开言路
    2021-02-09 02:38

    The code you posted should work.

    Try putting this at the beginning of the DragEnter method

    string formats = string.Join( "\n", e.Data.GetFormats(false) );
    MessageBox.Show( formats );
    

    which will dump data formats associated with the d'n'd operation. Might help us narrowing down where the problem lies.

提交回复
热议问题