标签:
private void listBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { if(e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.All; else e.Effect = DragDropEffects.None; }
private void listBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { string[] s = (string[]) e.Data.GetData(DataFormats.FileDrop, false); int i; for(i = 0; i < s.Length; i++) listBox1.Items.Add(s[i]); }
this.listBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listBox1_DragDrop); this.listBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.listBox1_DragEnter);
关键字: |
kbhowto kbhowtomaster KB307966 |
HOW TO: 在 Visual C# .NET 应用程序中提供文件拖放功能
标签:
原文地址:http://www.cnblogs.com/Impulse/p/4494425.html