我想在我的标签中显示的文本很长,因此我考虑使文本从左到右在标签内滑动。
这可能在VB.net中吗?
您可以;
Public Class Form1
Dim BigStr As String = " this is a very big string, and I want to slide it ya ya ya "
Dim Pointer As Integer = 0
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label1.Text = BigStr.Substring(Pointer, 5)
Pointer = Pointer + 1
Pointer = Pointer Mod (BigStr.Length - 6)
End Sub
End Class
别忘了启用计时器