Skip to main content

Microsoft Silverlight

Unanswered Question Locking mouse within a canvasRSS Feed

(0)

amitbisla
amitbisla

Member

Member

4 points

3 Posts

Locking mouse within a canvas

Hi,

I would like to know how I can restrict the mouse within a canvas if left button is pressed?

Actually, this is part of a drag and drop operation, I don't want the mouse to move out of the outermost canvas if the drag operation is on. 

 

Best Regards,

Amit

Dave Britton
Dave Bri...

Member

Member

681 points

229 Posts

Re: Locking mouse within a canvas

No easy way to do this that I can think of.  Can you just "drop" when you get to the boundary instead?

=> Dave

Senior Engineer/Dev Manager, Vertigo Software
Vertigo

amitbisla
amitbisla

Member

Member

4 points

3 Posts

Re: Locking mouse within a canvas

Hi Dave,

Thanks for the suggestion.  

Regards,

~Amit

Adam Kinney
Adam Kinney

Member

Member

94 points

19 Posts

Microsoft

Re: Locking mouse within a canvas

Using the captureMouse method may be useful for you as well: http://msdn2.microsoft.com/en-us/library/bb412388.aspx#Implementing_Drag_and_Drop

Dave Britton
Dave Bri...

Member

Member

681 points

229 Posts

Re: Locking mouse within a canvas

Looks like a very usefull method!

Senior Engineer/Dev Manager, Vertigo Software
Vertigo

amitbisla
amitbisla

Member

Member

4 points

3 Posts

Re: Locking mouse within a canvas

In that case, if I move out of plugin with the left button down and enter the plugin again, it behaves in some unexpected manner.

 Best Regards,

~Amit

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities