且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

字幕效果

更新时间:2021-12-28 06:12:58

看看这篇文章:
易于使用Marquee Control for Windows Form且具有完全设计者支持的功能 [
Have a look at this article:
Easy to Use Marquee Control for Windows Form with Full Designer Support[^]

It''s a marquee control in Winforms as you want, it''s just that it''s in C#. But that shouldn''t be a an issue. Either you can use it directly or convert it into VB.NET. All you want is in it. :thumbsup:


我可以给您伪造...您可以将标签的长度增加1,而将标签的左侧减少1 ...使用计时器,您可以这样字幕的效果.
i can give you the pesudo... u can increase the length of a label by 1 while decrease its left by 1... using a timer this way u can make the effect of a marque.


我为u编写了代码

这是...标签的名称是lblmarquee,计时器的名称是计时器1 ...计时器设置为35 ...您可以将其更改为所需的速度
-------------------------------------------------- ----------------------

私有子Timer1_Tick(ByVal发送者作为System.Object,ByVal e作为System.EventArgs)处理Timer1.Tick
如果(lblmarquee.Left)+(lblmarquee.Width)< = 0则
lblmarquee.Left = Me.Width


如果结束

lblmarquee.Left =(lblmarquee.Left)-100
结束子
-------------------------------------------------- --------------------------
i made the code for u

here it is... the label''s name is lblmarquee and the timer''s name is timer 1... the timer is set at 35... u can change it for the desired speed
------------------------------------------------------------------------

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If (lblmarquee.Left) + (lblmarquee.Width) <= 0 Then
lblmarquee.Left = Me.Width


End If

lblmarquee.Left = (lblmarquee.Left) - 100
End Sub
----------------------------------------------------------------------------