I have a Popup control that I added with my thumb so that I can drag it around the screen. The DragDelta thumb event was overloaded with the following:
private static void Thumb_DragDelta(object sender, DragDeltaEventArgs e) { Thumb thumb = (Thumb)sender; Popup popup = thumb.Tag as Popup; if (popup != null) { popup.HorizontalOffset += e.HorizontalChange; popup.VerticalOffset += e.VerticalChange; } }
Drag and drop works fine (I used the drag and drop example here: http://www.codeproject.com/Articles/43636/WPF-A-search ), except when the pop-up window comes to the end to control and switch to another (dual monitor setup ) For example, if I have a pop-up window open on the left monitor and start dragging it to the right when its right border touches the edge of the monitor, the movement will be unstable and begin to move around until I move on and it is displayed on another monitor.
I debugged this script, and this is an example of what is happening:
At edge of screen: HorizontalOffset = 600 HorizontalChange = 1 Move Right: HorizontalOffset = 601 HorizontalChange = -800 HorizontalOffset = -199 HorizontalChange = 401 HorizontalOffset = 200 HorizontalChange = -150
What gives this strange strobe effect to a popup when it moves to another monitor; Is there anything I need to do to get it to seamlessly transition through monitors?
source share