Debugging CaptureMouse and Focus
Posted: 14 Sep 2015, 10:59
Hi,
I'm doing some refactoring in my code and I'm facing a weird problem. What I want to have is a drag'n drop behaviour. I've basically followed what you did in your sample.
I had a Control deriving from Border, put it into the UIElement tree by declaring it in the Xaml part. Its purpose was basically to move within its parent Canvas and display some representation, capture the mouse on drag and receive move and button up events. It worked great.
Now, rather than declaring it in Xaml, I'm adding it to the parent Canvas's children through C++. But as soon as I've done that, the CaptureMouse method does not work anymore, returning false.
Is there a way for me to check what actually failed? Do you have an idea?
Many thanks,
Alexandre.
I'm doing some refactoring in my code and I'm facing a weird problem. What I want to have is a drag'n drop behaviour. I've basically followed what you did in your sample.
I had a Control deriving from Border, put it into the UIElement tree by declaring it in the Xaml part. Its purpose was basically to move within its parent Canvas and display some representation, capture the mouse on drag and receive move and button up events. It worked great.
Now, rather than declaring it in Xaml, I'm adding it to the parent Canvas's children through C++. But as soon as I've done that, the CaptureMouse method does not work anymore, returning false.
Is there a way for me to check what actually failed? Do you have an idea?
Many thanks,
Alexandre.