MouseOver触发器并以编程方式访问它们. [英] MouseOver Triggers and accessing them programmatically.

查看:96
本文介绍了MouseOver触发器并以编程方式访问它们.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个MouseOver触发器,它可以更改按钮的颜色.我想控制何时以编程方式激活该触发器.例如,当用户将鼠标移到屏幕的不同部分时,我要突出显示与屏幕的该部分相关的按钮.因此,我在左下方有5个按钮,当我将鼠标移到其中任何一个按钮上时,它们的背景都会改变.当我将鼠标移到主屏幕的某些部分上时,我希望更改这5个按钮之一的背景,以指示哪一个是相关的.我需要以编程方式进行此操作,但无法解决问题.

我有一个情节提要与突出显示和取消突出显示链接.因此,将鼠标移到上面,在触发器中的不同背景下淡入,然后进入触发器,然后在触发器退出时淡出.

感谢您提出任何建议. div>

->例如,当用户将鼠标移到 屏幕上,我要突出显示与该部分相关的按钮 屏幕.

我很高兴知道这些按钮与您在上面描述的屏​​幕部分之间的关​​系,特别是,请您在此处发布XAML代码以了解您如何在UI上布局元素.
>
感谢


Hi,

I have a MouseOver trigger which changes the colour of a button.  I would like to control when that trigger is activated programmatically.  For example, when the user moves the mouse over a different part of the screen, I want to highlight the buttn that is relevant for that part of the screen.  So I have 5 buttons down the left, and when I mve the mouse over any of them, their background changes.  When I move the mouse over certain parts of the main screen, I want the background of one of those 5 buttons to change, to indicate which one is relevant.  I need to do this programmatically, but cannot work out how.

I have a storyboard linked to the highlighting and de-highlighting. So mouse over, fade in different background in the trigger enter action, and fade out on trigger exit.

Thanks for any advice.

解决方案

-> For example, when the user moves the mouse over a different part of the screen, I want to highlight the buttn that is relevant for that part of the screen.

I am glad to know how those Buttons are related to those parts of screen you are describing above, in particular, could you please post your XAML code here to understand how you layout the elements on the UI?

Thanks


这篇关于MouseOver触发器并以编程方式访问它们.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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