I have a Windows form (a picture box) inside a WPF window. I desire drag 'n move functionality when clicking on my picture box. In order to do so, I catch my picture box MouseDown event and then raise a MouseLeftButtonDown event so that my WPF
window can get it and inside that event handler I call DragMove().
So I have this call inside my windows form event handler:
if (e.Button == MouseButtons.Left)
MouseDevice mouseDev = InputManager.Current.PrimaryMouseDevice;
MouseButtonEventArgs mouseEvent = new MouseButtonEventArgs(mouseDev, 0, MouseButton.Left)
RoutedEvent = MouseLeftButtonDownEvent
However when I check the left button of the mouse device, it's never in the state "Pressed", so when I call DragMove in the WPF handler, it throws an exception.
How do I get the mouse so that the left button is pressed? I can't set the states since it's all read-only...
Is what I'm trying to do possible? Or will I just have to do some math and manually set the top and left of the WPF window?
View Complete Post