StackPanel捕获鼠标的问题 [英] problem with capturemouse of stackpanel

查看:74
本文介绍了StackPanel捕获鼠标的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用以下代码捕获鼠标并在鼠标向上释放时释放,但无法正常工作.鼠标左面板..

Hello All,

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

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



谢谢



Thanks

推荐答案

如果您编辑ChildWindow模板,您将看到ChildWindow由一堆网格和边框定义.

您可以编辑扮演其角色的Grid,使其重叠其下的所有内容(它可能是ChildWindow可视树中定义的第一个或第二个Grid),并删除其Background,或者在其XAML定义中添加IsHitTestVisible ="false".
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.


这篇关于StackPanel捕获鼠标的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆