问题触发器 [英] Question Trigger
问题描述
< 样式 >
< Style.Triggers >
< 触发器
Property =" IsMouseOver"
值 =" True">
< Setter
Property ="背景"
值 =" Red">< / Setter > < / 触发器 >
< / Style.Triggers >
< / 样式 >
I
想要更改按钮的背景颜色,我使用background属性导致错误
错误
属性'背景'不是
类型FrameworkElement
尝试在你的Style上设置TargetType。否则你将尝试定位最基本类型(FrameworkElement);
< span style ="font-family:Consolas;颜色:#0000FF; font-size:x-small"> < 样式
TargetType ="按钮">
hth
标记跨度>
<Style>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Red"></Setter></Trigger>
</Style.Triggers>
</Style>
I want to change the background color of the button, I use the background attribute the errors they cause
Error Property 'Background' was not found in type FrameworkElement
Try setting the TargetType on your Style. Otherwise you'll be trying to target the base-most type (FrameworkElement);
<Style TargetType="Button">
hth
Mark
这篇关于问题触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!