In our application, we have subclassed from GoView and then subsequently overriden the “OnDragDrop” event logic as follows:
protected override void OnDragDrop(DragEventArgs evt)<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
// Warn the user if a copy is about to take place.
if (evt.Effect.Equals(DragDropEffects.Copy) && evt.Data.GetDataPresent("Northwoods.Go.GoSelection"))
DialogResult dr = MessageBox.Show("You are about to COPY. Is this OK?",
"Confirm Selection Copy",
return; // Abandon the DragDrop operation
The intent was to provide a warning when the use holds down the control key and drags (results in drag effect being set to copy) so that copy operations were an explicit decision on the part of the user. The warning is provided via the MessageBox.Show .
Here's the question/problem: After executing the MessageBox.Show and the subsequently calling base.OnDragDrop(evt), the "copy" seems to become a "move". If I comment out the MessageBox.Show, it works using the default behavior (ctrl-drag-drop = copy, drag-drop=move).
I'm sure I must be doing something fundamentally wrong, but can't figure it out. Any ideas? Thanks.