Form Text characters move right to left + Timer

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 3
Reputation: VijayKumaran is an unknown quantity at this point 
Solved Threads: 0
VijayKumaran VijayKumaran is offline Offline
Newbie Poster

Form Text characters move right to left + Timer

 
0
  #1
May 11th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form Text characters move right to left + Timer

 
0
  #2
May 11th, 2008
This code will display scroling text from left to right in Label.
First set timer Enable = True.
try this following code :
  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.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Dec 2002
Posts: 461
Reputation: waynespangler is on a distinguished road 
Solved Threads: 56
waynespangler waynespangler is offline Offline
Posting Pro in Training

Re: Form Text characters move right to left + Timer

 
1
  #3
May 12th, 2008
I don't like to correct anyone but you need to get away from vb6. To do it the net way
  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.
  1. Me.Text = Me.Text.Substring(1) & Me.Text.Substring(0, 1)
Wayne

It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form Text characters move right to left + Timer

 
0
  #4
May 12th, 2008
Originally Posted by waynespangler View Post
I don't like to correct anyone but you need to get away from vb6. To do it the net way
  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.
  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.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 3
Reputation: VijayKumaran is an unknown quantity at this point 
Solved Threads: 0
VijayKumaran VijayKumaran is offline Offline
Newbie Poster

Re: Form Text characters move right to left + Timer

 
0
  #5
May 12th, 2008
Originally Posted by Jx_Man View Post
This code will display scroling text from left to right in Label.
First set timer Enable = True.
try this following code :
  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
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 3
Reputation: VijayKumaran is an unknown quantity at this point 
Solved Threads: 0
VijayKumaran VijayKumaran is offline Offline
Newbie Poster

Re: Form Text characters move right to left + Timer

 
0
  #6
May 12th, 2008
Originally Posted by waynespangler View Post
I don't like to correct anyone but you need to get away from vb6. To do it the net way
  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.
  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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form Text characters move right to left + Timer

 
0
  #7
May 12th, 2008
you're welcome...
don't forget mark this thread solved
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC