|
-
Feb 3rd, 2009, 10:46 AM
#1
Thread Starter
Member
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
-
Feb 5th, 2009, 09:18 AM
#2
Frenzied Member
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.
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Feb 5th, 2009, 09:40 AM
#3
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
-
Feb 5th, 2009, 09:44 AM
#4
Frenzied Member
Re: drag canvas
Oh yeah, I think you're right - that stops the event from being routed any further.
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|