private void txtPage_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
DialogResult UserResponse = new DialogResult();
if (txtPage.Modified)
{
UserResponse = ConfirmOverwrite();
}
if (txtPage.Modified & UserResponse == DialogResult.Cancel)
{
return;
}
else if (txtPage.Modified & UserResponse == DialogResult.Yes)
{
SaveFile();
}
OpenFile(files[0]);
e.Data.SetData(null);
}
}