細かい点かもしれませんが、こういうのがあると便利だったりします。
textBoxという名前のUIがあったとすると、そのイベントTextBox_PreviewDragOverとTextBox_Dropに以下のメソッドを登録します。
private void textBox_PreviewDragOver(object sender, System.Windows.DragEventArgs e) {
if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop, true)) {
e.Effects = System.Windows.DragDropEffects.Copy;
} else {
e.Effects = System.Windows.DragDropEffects.None;
}
e.Handled = true;
}
private void textBox_Drop(object sender, System.Windows.DragEventArgs e) {
var dropFiles = e.Data.GetData(System.Windows.DataFormats.FileDrop) as string[];
if (dropFiles == null) return;
textBox.Text = dropFiles[0];
}
これで、パスの入力が簡単になります。