没有合适的资源?快使用搜索试试~ 我知道了~
本文实例为大家分享了WPF上下滚动字幕的具体代码,供大家参考,具体内容如下 XAML代码: <local:WorkSpaceContent x:Class=SunCreate.CombatPlatform.Client.NoticeMarquee xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/m
资源推荐
资源详情
资源评论






WPF实现上下滚动字幕效果实现上下滚动字幕效果
本文实例为大家分享了WPF上下滚动字幕的具体代码,供大家参考,具体内容如下
XAML代码:
<local:WorkSpaceContent x:Class="SunCreate.CombatPlatform.Client.NoticeMarquee"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SunCreate.CombatPlatform.Client;assembly=SunCreate.CombatPlatform.Client"
mc:Ignorable="d"
d:DesignHeight="35" d:DesignWidth="300" Loaded="WorkSpaceContent_Loaded" MouseEnter="WorkSpaceContent_MouseEnter"
MouseLeave="WorkSpaceContent_MouseLeave">
<local:WorkSpaceContent.Resources>
<ControlTemplate x:Key="btnTemplate" TargetType="Button">
<TextBlock Name="txt" Margin="5 0 5 0" Text="{TemplateBinding Content}" FontSize="12" Cursor="Hand" ToolTip="{TemplateBinding ToolTip}"
Foreground="#fff" VerticalAlignment="Center"></TextBlock>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="txt" Property="Foreground" Value="#ff5e5e"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Storyboard x:Key="storyboard">
<DoubleAnimation Duration="0:0:1" To="25" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="RenderTransform.Y"/>
</Storyboard>
</local:WorkSpaceContent.Resources>
<Grid Background="#00a6da">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Margin="15 0 5 0" Text="公告:" FontSize="12" Foreground="#ffff33" VerticalAlignment="Center"></TextBlock>
<ScrollViewer Grid.Column="1" Name="scrollViewer" HorizontalScrollBarVisibility="Hidden"
HorizontalContentAlignment="Stretch"
VerticalScrollBarVisibility="Hidden"
VerticalContentAlignment="Stretch" Height="25">
<Border Height="25" >
<StackPanel x:Name="stackPanel" Margin="0 -25 0 0" >
<StackPanel.RenderTransform>
<TranslateTransform />
</StackPanel.RenderTransform>
<Button Name="btn1" Height="25" Click="btn_Click" Template="{StaticResource btnTemplate}"></Button>
<Button Name="btn2" Height="25" Click="btn_Click" Template="{StaticResource btnTemplate}"></Button>
<Button Name="btn3" Height="25" Click="btn_Click" Template="{StaticResource btnTemplate}"></Button>
</StackPanel>
</Border>
</ScrollViewer>
</Grid>
</local:WorkSpaceContent>
后台代码:
using SunCreate.CombatPlatform.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SunCreate.CombatPlatform.Client
{
/// <summary>
资源评论

- 梦之Q蓝2022-03-30这个文档网上一堆,都是相互抄写的,骗人,不全,更不没法用。

weixin_38629042
- 粉丝: 7
- 资源: 928
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
