-
drag canvas
Hi,
My application contains 3 tab. Everything including tabcontrol, canvas, etc is done using vb code. And the dragging of canvas is in the 2nd tab.
I used this website as a reference for the drag canvas.
http://blogs.msdn.com/marcelolr/arch...02/542641.aspx
There is no error in my application. But when I debug my application, I could not click on the 2nd and 3rd tab.
But when I comment the coding below, I can click on the 2nd and 3rd tab:
Private Sub MyCanvas_PreviewMouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles MyCanvas.PreviewMouseLeftButtonDown
If MyCanvas Is e.Source Then
Exit Sub
End If
m_IsDown = True
m_StartPoint = e.GetPosition(MyCanvas)
m_OriginalElement = e.Source
MyCanvas.CaptureMouse()
e.Handled = True
End Sub
Anyone know how to solve it...? I'm using WPF application.
Thanks
-
Re: drag canvas
Hmm... That does sound rather strange. Have you tried tieing a mouseclick event to the tabcontrol to see if it fires?
Might be because you've captured the mouse in your canvas, and somehow the routed event never reaches the tab control - it does seem unlikely though.
-
Re: drag canvas
Actually, I think it's this:
e.Handled = True
By telling the system it's been handled, if I remember right, that prevents any further processing on it... which cancels any further event calls.
-tg
-
Re: drag canvas
Oh yeah, I think you're right - that stops the event from being routed any further.