silverlight 滚动文字
来源:互联网 发布:淘宝饰品店发展前景 编辑:程序博客网 时间:2024/06/05 19:14
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" Grid.Row="1"
VerticalScrollBarVisibility="Hidden" BorderThickness="0" Height="36">
<Canvas Loaded="MarqueeControl_Loaded" Width="592" HorizontalAlignment="Left">
<Canvas.Resources>
<Storyboard x:Name="sb">
<DoubleAnimation x:Name="da" BeginTime="00:00:04"
Storyboard.TargetName="txtLorem"
Storyboard.TargetProperty="(Canvas.Left)"
From="0" RepeatBehavior="Forever"/>
</Storyboard>
</Canvas.Resources>
<TextBlock x:Name="txtLorem" Width="596" Height="33" VerticalAlignment="Center" Style="{StaticResource Block1}" Margin="0,0,0,0" />
</Canvas>
</ScrollViewer>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace DB_Typhoon.elements
{
public partial class rollbottom : UserControl
{
public rollbottom(string text)
{
InitializeComponent();
this.txtLorem.Text = text;
}
private void MarqueeControl_Loaded(object sender, RoutedEventArgs e)
{
var canvas = sender as Canvas;
if (txtLorem.ActualWidth <= canvas.Width) return;
const double speed = 50;
da.To = -txtLorem.ActualWidth;
da.Duration = new Duration(TimeSpan.FromSeconds(txtLorem.ActualWidth / speed));
sb.Begin();
}
}
}
- silverlight 滚动文字
- Silverlight实现滚动文字
- silverlight应用(一):ScrollViewer 文字滚动
- 文字滚动
- 滚动文字
- 文字滚动
- 滚动文字
- 文字滚动
- 文字滚动
- 文字滚动
- 文字滚动
- 滚动文字
- 文字滚动
- 文字滚动
- 文字滚动
- 文字滚动
- 文字滚动
- Silverlight 滚动条
- 一个简单的java版GUI窗口
- mongodb启动出错
- Web开发人员需知的Web缓存知识
- 2013年9月25日星期三
- 分布式云数据中心解决方案
- silverlight 滚动文字
- Eclipse中Cannot find any provider supporting DES解决之道
- Oracle 内连接和外连接
- Matlab 函数 sparse & full
- sybase 表数据同步
- Bean 字段生产xml
- 中国空“芯”之忧:一年进口芯片总值超石油
- Java几款性能分析工具的对比
- 登录后返回登录前的页面