相关疑难解决方法(0)

WPF应用程序上的闪烁按钮

我的WPF应用程序有一个我在混合上构建的样式管理器.

我的问题是:我有一个偶尔闪烁的登录按钮,我无法弄清楚如何删除此行为.

这是我的登录框的样式代码:

<Style x:Key="LoginBoxGrid" TargetType="{x:Type Grid}">
    <Setter Property="Background">
        <Setter.Value>
            <ImageBrush ImageSource="/Client;component/Assets/images/LoginBox.png" Stretch="None" TileMode="Tile"/>
        </Setter.Value>
    </Setter>

    <Setter Property="Opacity" Value="0.765"/>
    <Setter Property="Width" Value="411"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="Margin" Value="126,150,0,111"/>
</Style>
<Style x:Key="LoginBoxHeader" TargetType="{x:Type Label}">
    <Setter Property="Grid.Column" Value="2"/>
    <Setter Property="Margin" Value="-16.183,18.347,0,0"/>
    <Setter Property="Width" Value="64.994"/>
    <Setter Property="FontSize" Value="16"/>
    <Setter Property="FontWeight" Value="Bold"/>
    <Setter Property="FontStyle" Value="Italic"/>
    <Setter Property="Foreground" Value="White"/>
    <Setter Property="VerticalAlignment" Value="Top"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="FontFamily" Value="/Client;component/Assets/Fonts/#Arial Black"/>
</Style>

<Style x:Key="LoginBtn" TargetType="{x:Type Button}">
    <Setter Property="Grid.Column" Value="2"/>
    <Setter Property="Margin" Value="16.6,9.022,9.282,8"/>
    <Setter Property="Grid.Row" Value="4"/>
    <Setter Property="Width" …
Run Code Online (Sandbox Code Playgroud)

c# asp.net wpf blend styling

14
推荐指数
4
解决办法
2万
查看次数

闪烁TextBlock

嗨iam试图让Wpf TextBlock闪烁.我希望当我点击一个按钮时,文本块会闪烁.我怎么能做到这一点.

我尝试了以下内容.

<TextBlock Name="txtBlockScannerText" Margin="10,0,0,0" Style="{StaticResource TextBlockNormal}" Text="Skanna Inleverans listan">
    <TextBlock.Triggers>
        <EventTrigger RoutedEvent="TextBlock.MouseEnter">
            <EventTrigger.Actions>
                <BeginStoryboard>
                    <Storyboard BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="txtBlockScannerText" Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)">
                        <ColorAnimation From="Black" To="Red" Duration="0:0:1"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
    </TextBlock.Triggers>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)

但是这个代码只有在鼠标输入时才会闪烁.如何在按钮单击事件中触发闪烁.或者我如何调用事件闪烁.感谢帮助

wpf

3
推荐指数
3
解决办法
2万
查看次数

标签 统计

wpf ×2

asp.net ×1

blend ×1

c# ×1

styling ×1