How to scroll user input text using windows application
How to scroll user input text using windows application
How to scroll user input text using windows applicationAbstract
From this article we will discuss "How to scroll user input text using windows application".
In run time just give some text in text box control then click the button,the text will scroll until the program is closed.First,add the two labels ,a text box and button control to your form.
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text.Trim() = "" Then
Button1.Enabled = False
Else
Button1.Enabled = True
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Enabled = False
StartScroll()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Enabled = False
End Sub
Private Sub StartScroll()
Dim sb As New System.Text.StringBuilder(textBox1.Text & " ")
Do
Dim ch As Char = sb(sb.Length - 1)
sb.Remove(sb.Length - 1, 1)
sb.Insert(0, ch)
Label1.Text = sb.ToString()
Label1.Refresh()
System.Threading.Thread.Sleep(100)
Loop
End Sub
End Class