很早以前有项目就需要文字无缝滚动的效果但无奈当时技术不到位 人也比较懒惰(大概程序猿都是这个样子吧)

此方法并非只文字无缝其实任何内容都可以

     <ScrollViewer Name="scroll_div" Width="240" VerticalAlignment="Center" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden">
<StackPanel Orientation="Horizontal">
<TextBlock Name="scroll_begin">并非只可以滚动文字,此标签可以更改为任何控件内容。。</TextBlock>
<ContentControl Name="scroll_end"/>
</StackPanel>
</ScrollViewer>
     WithEvents timer As New System.Windows.Threading.DispatcherTimer
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
Dim xaml As String = System.Windows.Markup.XamlWriter.Save(scroll_begin)
scroll_end.Content = System.Windows.Markup.XamlReader.Parse(xaml)
timer.Interval = TimeSpan.FromMilliseconds()
timer.Start()
End Sub
Private Sub timer_Tick(sender As Object, e As EventArgs) Handles timer.Tick
If (scroll_end.ActualWidth - scroll_div.HorizontalOffset <= ) Then
scroll_div.ScrollToHorizontalOffset(scroll_div.HorizontalOffset - scroll_begin.ActualWidth)
Else
scroll_div.ScrollToHorizontalOffset(scroll_div.HorizontalOffset + )
End If
End Sub

wpf 无缝滚动的更多相关文章

  1. JavaScript学习笔记5 之 计时器 & scroll、offset、client系列属性 & 图片无缝滚动

    一.计时器 setInterval ( 函数/名称 , 毫秒数 )表示每经过一定的毫秒后,执行一次相应的函数(重复) setTimeout ( 函数/名称 , 毫秒数 ) 表示经过一定的毫秒后,只执行 ...

  2. JQuery的无缝滚动

    图片无缝向左滚动的代码如下:   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h ...

  3. JS 阶段小练习~ 无缝滚动

    结合下学了的知识,做个模拟的综合性扩展练习~~  大致功能如下: 1.点开html后,图片自动移动展示 2.点击左右方向,可以改变 图片移动的方向(改变left的值,正负) 3.鼠标移入移出图片后,图 ...

  4. 自己写了一个无缝滚动的插件(jQuery)

    效果图: html代码: 1 <h1>无缝滚动,向右滚动</h1> 2 <ul id="guoul1"> 3 <li><img ...

  5. js 无缝滚动效果学习

    <!DOCTYPE html> <html> <head> <title>无缝滚动测试</title> <meta http-equi ...

  6. Javascript学习之无缝滚动

    无缝滚动Javascript: <!DOCTYPE html> <html> <head> <meta charset="utf-8"&g ...

  7. js基础教程四之无缝滚动

    前面学习了相关js的一些基础知识,这节主要针对定时器作综合运用: 无缝滚动-基础 效果演示: *物体运动基础 *让div移动起来 *offsetLeft的作用 *用定时器让物体连续移动 <sty ...

  8. 带无缝滚动的轮播图(含JS运动框架)

    今天学习了一下轮播图的写作,想到前一阵学过的无缝滚动得思想,所以就把轮播与滚动结合了一下.不过我的代码的神逻辑我自己都不敢恭维,在没网没参照的情况下,只能硬着头皮往下写,希望跟大家共勉吧. js运动框 ...

  9. liMarquee演示12种不同的无缝滚动效果

    很实用的一款liMarquee演示12种不同的无缝滚动效果 在线预览 下载地址 实例代码 <!DOCTYPE html> <html lang="zh-CN"&g ...

随机推荐

  1. 将字符串XX,SS以“,”符号进行区分并分别存储在数组中

    public static void main(String[] args) { String str = "EAN_13,1534651"; String strs[] = st ...

  2. XLua基础

    一.Lua文件加载 1).Resources加载xluaTest文件 2).通过loader加载  3).自定义Loader(相当于Resources加载和loader加载结合)    先自定义Loa ...

  3. MySQL数据备份方法

    MySQL的备份和还原 备份:副本    RAID1,RAID10:保证硬件损坏而不会业务中止:        DROP TABLE mydb.tb1; 备份类型:        热备份.温备份和冷备 ...

  4. [Swift]LeetCode349. 两个数组的交集 | Intersection of Two Arrays

    Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...

  5. [Swift]LeetCode720. 词典中最长的单词 | Longest Word in Dictionary

    Given a list of strings words representing an English Dictionary, find the longest word in words tha ...

  6. [Swift]LeetCode828. 独特字符串 | Unique Letter String

    A character is unique in string S if it occurs exactly once in it. For example, in string S = " ...

  7. [Swift]LeetCode927. 三等分 | Three Equal Parts

    Given an array A of 0s and 1s, divide the array into 3 non-empty parts such that all of these parts ...

  8. CoCos2dx开发:tile地图绘制和Tiled工具的基本使用

    1.新建地图: 在Tiled工具里新建文件: 设置地图的地图大小和地图块大小: 新建好的空文件如下: 2.绘制图块: 在Aseprite中建立相应大小(注意:划分的图块为32*32,因此图片大小最好与 ...

  9. P5241 序列

    分析 题目要求在一共加入若干条边是的不同B序列的个数:方便统计,我们不妨让一个B序列对应一种特定的操作来构造,具体如下 从1开始按从小到大加入点,始终维护一个顺序为加点次序的链:每次加入一条有向边 不 ...

  10. SpringMVC+JWT+Swagger UI+RestFul

    前言: 其实很早就想写这篇文章了,因为我觉得这会对很多新手有指引作用,当初自己也是瞎子过河的摸索着过来的.目前后台开发比较流行的MVC框架中使用Spring MVC还是比较多的,当然还有Spring ...