Click here to Skip to main content
15,886,052 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello All,

I'm using following code for capture mouse and release on mouse up but not working effectively.Mouse left panel..

C#
void panel_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
       {          
           StackPanel panel = (StackPanel)sender;                     
           panel.CaptureMouse();                            
          
       }


Thanks
Posted
Updated 12-May-12 0:18am
v3
Comments
Sandeep Mewara 12-May-12 6:20am    
Can you elaborate: not working effectively part?
KIDYA 12-May-12 8:32am    
Means when I clicked on panel and try to move it slowly then its working fine and when I'm trying to move it fast then cursor place and panel place are different.
Sergey Alexandrovich Kryukov 12-May-12 22:52pm    
This is incomplete code. And why capturing mouse? You don't need it at all.
--SA

1 solution

If you Edit the ChildWindow template, you'll see that ChildWindow is defined by a bunch of grids and borders.

You can edit the Grid that plays the role to overlap everything under it (it may be the first or the second Grid defined in the ChildWindow Visual Tree), and remove its Background, or add an IsHitTestVisible="false" to its XAML definition.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900