this is a good snippet and this will be very useful for you , lets start
7. now debug and enjoy the text , textbox scrolling
9.debug and enjoy the text , label scrolling
1.open visual basic 2008/2010
2. create a new project
3. add a textbox and a timer
4. enable the timer
5.write something in the textbox (textbox1 > properties > text )
Public Class Form1 Public Function MarqueeLeft(ByVal Text As String) Dim Str1 As String = Text.Remove(0, 1) Dim Str2 As String = Text(0) Return Str1 & Str2 End Function Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick textbox1.Text = MarqueeLeft(textbox1.Text) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Timer1.Start() End Sub End Class
7. now debug and enjoy the text , textbox scrolling
8.if you want to make this to label simply add a label and write something(label1>properties>text) and paste this code
Public Class Form1 Public Function MarqueeLeft(ByVal Text As String) Dim Str1 As String = Text.Remove(0, 1) Dim Str2 As String = Text(0) Return Str1 & Str2 End Function Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Label1.Text = MarqueeLeft(Label1.Text) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Timer1.Start() End Sub End Class
9.debug and enjoy the text , label scrolling
11 comments
Very useful, thank-you!
ReplyThank You This is really useful thx GBU
Replythanks
ReplyHow would you get the text to scroll more smoothly? Instead of groupings of text.
ReplyYou have that many ads on your site I can barely see what Im trying to read.
ReplyCould you please tell how to add a text file so that the contents would be fetched and displayed and its moving smootly.
ReplyCould you please tell how to add a text file so that the contents would be fetched and displayed and its moving smootly.
ReplyI set the size of textbox width same as Screen.PrimaryScreen.Bounds.Width, then the text in textbox only display start from half of box..Do you know how to set the length size of textbox.text equal to size textbox?
ReplyI already know how to solve this.... Actually i put wrong syntax code when i read and execute data from sql...my bad... by the way thank u for coding above, it very useful for me
ReplySuper Bowl 51
ReplyPatriots vs Falcons
Super Bowl 2017
Falcons vs Patriots
Watch Super Bowl 2017
Super Bowl 2017 halftime show
Super Bowl 2017 Live
super bowl 2017
Replysuper bowl 2017 live
super bowl 2017 time
2017 super bowl
watch super bowl 2017
Post a Comment
Note: Only a member of this blog may post a comment.