Silverlight 4.0 鼠标悬停时使用VSM更改文本块前景?

Silverlight 4.0 鼠标悬停时使用VSM更改文本块前景?,silverlight-4.0,expression-blend-4,Silverlight 4.0,Expression Blend 4,有人知道如何使用VSM将文本块的文本颜色从“红色”更改为“蓝色”吗?文本块是否有按钮、文本框之类的模板。。。等等感谢您的帮助并期待您的回复…您可以使用文本框并在鼠标上方设置颜色背景 <TextBox TextWrapping="Wrap" Background="#FFBA2C2C" Height="20"> <TextBox.Template> <ControlTemplate> <

有人知道如何使用VSM将文本块的文本颜色从“红色”更改为“蓝色”吗?文本块是否有按钮、文本框之类的模板。。。等等感谢您的帮助并期待您的回复…

您可以使用文本框并在鼠标上方设置颜色背景

<TextBox TextWrapping="Wrap" Background="#FFBA2C2C" Height="20">
        <TextBox.Template>
            <ControlTemplate>
                <StackPanel Orientation="Horizontal">
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <ColorAnimation  To="Red" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True" Duration="0"/>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <TextBlock x:Name="textBlock" Text="Click Me"/>
                    </StackPanel>
            </ControlTemplate>
        </TextBox.Template>
    </TextBox>

您可以使用文本框并在鼠标上方设置颜色背景

<TextBox TextWrapping="Wrap" Background="#FFBA2C2C" Height="20">
        <TextBox.Template>
            <ControlTemplate>
                <StackPanel Orientation="Horizontal">
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <ColorAnimation  To="Red" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True" Duration="0"/>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <TextBlock x:Name="textBlock" Text="Click Me"/>
                    </StackPanel>
            </ControlTemplate>
        </TextBox.Template>
    </TextBox>


你好,史密斯。帕特尔非常感谢你的帮助,这是我想要的,再次感谢。你好,史密斯。帕特尔非常感谢你的帮助,这是我想要的,再次感谢。