Tag: vista64

从Windows文件资源管理器拖放到Windows窗体上无法正常工作

我在将文件从Windows资源管理器拖到Windows窗体应用程序时遇到问题。 我拖动文本时工作正常,但由于某种原因它无法识别文件。 这是我的测试代码: namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_DragDrop(object sender, DragEventArgs e) { } private void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) { e.Effect = DragDropEffects.Copy; } else if (e.Data.GetDataPresent(DataFormats.FileDrop)) { e.Effect = DragDropEffects.Copy; } else { e.Effect = DragDropEffects.None; } } […]