在VB.NET WPF中从右到左滚动文本时代码不起作用 [英] Code Not Working When Scrolling Text Right to Left in VB.NET WPF

查看:75
本文介绍了在VB.NET WPF中从右到左滚动文本时代码不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WPF VB.NET中制作天气程序。我有一个天气预警自动收报机,在发出警报时显示。由于某种原因,滚动条将向上,向下或向右滚动,但它不会从左向右滚动。下面是代码:

I am making a weather program in WPF VB.NET. I have a weather alert ticker that is displayed when an alert is issued. The ticker for some reason will scroll either up, down, or right, but it won't scroll left to right. Here is the code:

Dim doubleAnimation As DoubleAnimation = New DoubleAnimation()
        doubleAnimation.From = -tbmarquee.ActualWidth
        doubleAnimation.To = Canvas1.ActualWidth
        doubleAnimation.RepeatBehavior = RepeatBehavior.Forever
        doubleAnimation.Duration = New Duration(TimeSpan.Parse("0:0:20"))
        tbmarquee.BeginAnimation(Canvas.RightProperty, doubleAnimation)

它说canvas.RightProperty就是搞乱的地方。我希望它从右向左滚动。当设置为正确时,它会采用相反的方式,我不认为向后阅读天气警报是个好主意。我不得不添加一个按钮来测试它(我想要
它开始滚动当股票代码首次显示并暂停并重置到它隐藏的股票代码的开头)当我点击按钮从右边滚动到离开了,它什么也没做。发生了什么以及如何解决?

Where it says canvas.RightProperty is where it messes up. I want it to scroll from right to left. When set to right, it goes the opposite way and I don't think it is a good idea to read a weather alert backwards. I had to add a button to test it (I want it to start scrolling when the ticker first shows and pause and reset to the beginning of the ticker when it hides) and when I click the button to scroll from right to left, it does nothing. What is going on and how can it be fixed?

谢谢!!!

推荐答案

因为这个是WPF我正在将您的问题转移到该论坛以获得更好的支持。
Since this is WPF I'm moving your question to that forum for better support.


这篇关于在VB.NET WPF中从右到左滚动文本时代码不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆