943,871 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 8134
  • VB.NET RSS
May 11th, 2008
0

Form Text characters move right to left + Timer

Expand Post »
Dear friends,
In VB.NET... How to write coding "Form Text characters move slowly right to left using of Timer"? Please help me and solve my doubt.

Yours,

Vijaykumaran
Reputation Points: 10
Solved Threads: 0
Newbie Poster
VijayKumaran is offline Offline
3 posts
since May 2008
May 11th, 2008
0

Re: Form Text characters move right to left + Timer

This code will display scroling text from left to right in Label.
First set timer Enable = True.
try this following code :
vb.net Syntax (Toggle Plain Text)
  1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2. label1.Text = Microsoft.VisualBasic.Right _
  3. (label1.Text, 1) & Microsoft.VisualBasic.Left _
  4. (label1.Text, Len(label1.Text) - 1)
  5. End Sub
Last edited by Jx_Man; May 11th, 2008 at 12:10 pm.
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
May 12th, 2008
1

Re: Form Text characters move right to left + Timer

I don't like to correct anyone but you need to get away from vb6. To do it the net way
VB.NET Syntax (Toggle Plain Text)
  1. TextBox1.Text = TextBox1.Text.Substring(1) & TextBox1.Text.Substring(0, 1)
The first pram is the starting index (0 being the first character). If you omit the second pram then the rest of the string is used. So if the string is "012345" then TextBox1.Text.Substring(1) will return "12345".
The second pram is the length of what you want. In this case the second part Substring(0,1) is getting the first character. It will move the first character to the end of the string.

I'm not good at explaining but I hope you understand what I am trying to say.

If you want something cool, do this to the title bar and look at the task bar. You can do this to show what is happening in your program even it the application is not showing.
VB.NET Syntax (Toggle Plain Text)
  1. Me.Text = Me.Text.Substring(1) & Me.Text.Substring(0, 1)
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
May 12th, 2008
0

Re: Form Text characters move right to left + Timer

I don't like to correct anyone but you need to get away from vb6. To do it the net way
VB.NET Syntax (Toggle Plain Text)
  1. TextBox1.Text = TextBox1.Text.Substring(1) & TextBox1.Text.Substring(0, 1)
The first pram is the starting index (0 being the first character). If you omit the second pram then the rest of the string is used. So if the string is "012345" then TextBox1.Text.Substring(1) will return "12345".
The second pram is the length of what you want. In this case the second part Substring(0,1) is getting the first character. It will move the first character to the end of the string.

I'm not good at explaining but I hope you understand what I am trying to say.

If you want something cool, do this to the title bar and look at the task bar. You can do this to show what is happening in your program even it the application is not showing.
VB.NET Syntax (Toggle Plain Text)
  1. Me.Text = Me.Text.Substring(1) & Me.Text.Substring(0, 1)
Thank you for corrected me...
My post is fully vb6 concept. hope to learn much from you
Great friend.
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
May 12th, 2008
0

Re: Form Text characters move right to left + Timer

Click to Expand / Collapse  Quote originally posted by Jx_Man ...
This code will display scroling text from left to right in Label.
First set timer Enable = True.
try this following code :
vb.net Syntax (Toggle Plain Text)
  1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2. label1.Text = Microsoft.VisualBasic.Right _
  3. (label1.Text, 1) & Microsoft.VisualBasic.Left _
  4. (label1.Text, Len(label1.Text) - 1)
  5. End Sub
Dear Friend,
Thank you so much for answered my question and solved my doubt. Your code is working well and I am happy.

Yours,

Vijaykumaran
Reputation Points: 10
Solved Threads: 0
Newbie Poster
VijayKumaran is offline Offline
3 posts
since May 2008
May 12th, 2008
0

Re: Form Text characters move right to left + Timer

I don't like to correct anyone but you need to get away from vb6. To do it the net way
VB.NET Syntax (Toggle Plain Text)
  1. TextBox1.Text = TextBox1.Text.Substring(1) & TextBox1.Text.Substring(0, 1)
The first pram is the starting index (0 being the first character). If you omit the second pram then the rest of the string is used. So if the string is "012345" then TextBox1.Text.Substring(1) will return "12345".
The second pram is the length of what you want. In this case the second part Substring(0,1) is getting the first character. It will move the first character to the end of the string.

I'm not good at explaining but I hope you understand what I am trying to say.

If you want something cool, do this to the title bar and look at the task bar. You can do this to show what is happening in your program even it the application is not showing.
VB.NET Syntax (Toggle Plain Text)
  1. Me.Text = Me.Text.Substring(1) & Me.Text.Substring(0, 1)
Dear Friend,
Thank you so much for answered my question and solved my doubt. Your code is working well and I am happy.

Yours,

Vijaykumaran
Reputation Points: 10
Solved Threads: 0
Newbie Poster
VijayKumaran is offline Offline
3 posts
since May 2008
May 12th, 2008
0

Re: Form Text characters move right to left + Timer

you're welcome...
don't forget mark this thread solved
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
3 Days Ago
0
Re: Form Text characters move right to left + Timer
how to make it moving from left to right?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
person_112 is offline Offline
1 posts
since Feb 2012
Message:
Previous Thread in VB.NET Forum Timeline: Problem with byte to mysql
Next Thread in VB.NET Forum Timeline: can anyone help me with this please! i have problem regarding SQL queries





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC