473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,383 developers and data experts.

Auto Scroll text in a static label

133 100+
Well i cannont remember where i picked this code up, but i have seen
it asked for in many forums, Many times so i thought i'd add it here (Since this is my favourite forum).


Auto scroll text in a static label.

To your Form...
Add 1 label
Add 1 command Button
Add 1 Timer
Add 1 Textbox

Code: ( vb 6 )

DECLARATIONS:

Expand|Select|Wrap|Line Numbers
  1.     Dim s As Integer
  2.     Dim dta As String
  3.  
  4.  
  5. Private Sub Command1_Click()
  6.     Label1.Caption = ""
  7.     Timer1.Enabled = True
  8.     Timer1.Interval = 100
  9.     Label1.Width = 4335
  10.     Label1.Font = "Palatino Linotype"
  11.     Label1.Font.Size = 13
  12.     Label1.Font.Bold = False
  13. End Sub
  14.  
  15. Private Sub Timer1_Timer()
  16.  
  17.     ' put your text here in dta string
  18.     dta = "Whatever text you want to scroll" & Space$(40)
  19.     s = s + 1
  20.     Label1.Caption = Mid(dta, 1, s)
  21.     If Len(Label1.Caption) >= 42 Then Label1.Caption = Right(Label1.Caption, 41)
  22.  
  23.     If s = Len(dta) Then
  24.         Label1.Caption = ""
  25.         s = 0
  26.     End If
  27. End Sub
It is very self explanatory very easy to use just cut & paste code , and then add command button, timer and label.

Hope this helps , if you like this i have 85 more basic / very usefull how to's ready to use code samples.

GobbleGob.
Thanks for reading.
Mar 13 '08 #1
0 9865

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Marek Mänd | last post by:
<select multiple style="height:200px;"> <option>a <option>b </select> Why does Mozilla draw the vertical scrollbar to the SELECT html element? There is plenty of void room below two OPTIONs in...
0
by: Alex Moskalyuk | last post by:
I am using System.Windows.Forms.TextBox to publish some real-time data that's coming off the external devices. My data is fed into the TextBox with proper precautions not to exceed the MaxSize...
5
by: Wilfried Mestdagh | last post by:
Hello, textBox += someData + "\r\n"; does not scroll the visible text to the end. How do I perform that ? Also this way seems to me a lot of reallocating memory. Is there better way to add...
7
by: J-T | last post by:
My website is fine when it is viewed in 1280 by 1024 pixel ,but in smaller resulotions there is a horizontal scrollbar down the page.How can I set it to be viewed the same for all resulotions? ...
2
by: JonnyT | last post by:
I searched high and low for an answer on how to auto scroll a richtextbox and now I finally have it. Since it took me a while to get a good efficient way of doing it that didn't require focus to...
0
by: 23s | last post by:
Is there any way I can send a vertical value to a form's scroll position? I have a full-screen form that, at launch, contains an empty tab sheet. At run time, the user can dynamically append a...
1
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
3
vavc1980
by: vavc1980 | last post by:
Hello, I have a form in Access that imports some information from Excel and text files. I'm displaying the progress in an editbox, one detail in each line, however, if the content of the editbox...
1
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.