private void rtbText_PreviewDragEnter(object sender, DragEventArgs e) {
if (e.Data.GetDataPresent(DataFormats.FileDrop)) {
e.Effects = DragDropEffects.All;
} else {
e.Effects = DragDropEffects.None; } }
private void rtbText_PreviewDrop(object sender, DragEventArgs e)
{ System.Windows.Documents.TextRange range;
string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, true);
string s = "";
foreach (string File in FileList) s = s + " " + File;
range = new System.Windows.Documents.TextRange(rtbText.Document.ContentStart, rtbText.Document.ContentEnd);
range.Text = s; }