File drag and drop method

xiaoxiao2021-03-06  62

private void Form1_DragEnter (object sender, System.Windows.Forms.DragEventArgs e) {if (e.Data.GetDataPresent (DataFormats.FileDrop)) e.Effect = DragDropEffects.Link; else e.Effect = DragDropEffects.None;} private void Form1_dragdrop (Object Sender, System.Windows.Forms.drageventargs E) {// Where Label1.Text shows the file name dragged into the file;

Label1.text = (System.Array) E.Data.GetData (DataFormats.Filedrop). getValue (0) .tostring ();

转载请注明原文地址:https://www.9cbs.com/read-86423.html

New Post(0)