public Form1() { InitializeComponent(); button1.AllowDrop = true; } private void button1_DragEnter(object sender, DragEventArgs e) { e.Effect = e.Data.GetDataPresent("FileNameW") ? DragDropEffects.Move : DragDropEffects.None; string s = (string)e.Data.GetData(DataFormats.FileDrop, false); button1.Text = s; }
string[] file = (string[])e.Data.GetData(DataFormats.FileDrop); if (file != null && file.Length != 0) { button1.Text = file[0]; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)