|
-
Sep 7th, 2007, 11:50 AM
#1
Thread Starter
Hyperactive Member
[VB 2005] Scrolling Text - Right To Left
Created some scrolling text, can be used for news bulletins, announcements etc.
You need:
Label - name: label1
Timer - name: timscroll - interval: 10 - enabled: true
Code:
Private Sub timscroll_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timscroll.Tick
If Label1.Left = 0 - Label1.Width Then
Label1.Left = Me.Width
Label1.Left = Label1.Left - 1
Else
Label1.Left = Label1.Left - 1
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Left = Me.Width
End Sub
Hope It Helps! 
-----
knxrb
-
Sep 13th, 2007, 03:46 PM
#2
Re: [VB 2005] Scrolling Text - Right To Left
Cool... But what if I don't want to move the label since it may runs over my other controls on the form? In essence, I want the label's location to stay fixed while the text inside it scrolls...
-
Sep 14th, 2007, 03:38 AM
#3
Thread Starter
Hyperactive Member
Re: [VB 2005] Scrolling Text - Right To Left
I'll look into it and see if I can get it to do that
I'll reply when I find an answer.
------
KNXRB
-
Sep 14th, 2007, 10:16 AM
#4
Re: [VB 2005] Scrolling Text - Right To Left
if you want the label to remain fixed while the text is scrolling, you'll need to look into GDI+ for drawing strings
-
Sep 14th, 2007, 01:06 PM
#5
Re: [VB 2005] Scrolling Text - Right To Left
 Originally Posted by JuggaloBrotha
if you want the label to remain fixed while the text is scrolling, you'll need to look into GDI+ for drawing strings
Not neccesarily... You can use string.substring to remove a character at one end and append it back at the other end of the string.
-
Sep 16th, 2007, 08:08 PM
#6
Re: [VB 2005] Scrolling Text - Right To Left
 Originally Posted by stanav
Not neccesarily... You can use string.substring to remove a character at one end and append it back at the other end of the string.
Yes, that part was assumed in my previous post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|