// Compose by LXT // this.txtMain.AllowDrop = true; private void txtMain_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { e.Effect = DragDropEffects.Copy; } } private void txtMain_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) // Có thể ko cần { string[] strFiles = (string[])e.Data.GetData(DataFormats.FileDrop); StreamReader reader = new StreamReader(strFiles[0]); this.txtMain.Clear(); this.txtMain.Text = reader.ReadToEnd(); reader.Close(); } }