Important alert: (current site time 7/16/2013 1:37:55 AM EDT)
 

VB icon

!!Scrolling text. (The Label is fixed)

Email
Submitted on: 8/10/1999
By: Martin Tonek 
Level: Not Given
User Rating: By 7 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 59028
 
     Let you scroll text in a label that is still fixed. It's easy and you will have the possibility to just add the sourcecode to a new project.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: !!Scrolling text. (The Label is fixed)
' Description:Let you scroll text in a label that is still fixed. It's easy and you will have the possibility to just add the sourcecode to a new project.
' By: Martin Tonek
'
' Returns:A scrolling text
'
' Assumes:Do NOT Edit to much or ju may corrupt the code.. se following instructions.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2896&lngWId=1'for details.'**************************************

'Put the code below in notepad and name it to form1.frm
'
'
'
'>>Mark from here<<
VERSION 5.00
Begin VB.Form Form1 
BackColor=&H80000007&
Caption ="(c)1999 Mr Slade, please visit me at http://hem.passagen.se/tonek/vb"
ClientHeight=2205
ClientLeft =60
ClientTop=345
ClientWidth =6120
ControlBox =0'False
LinkTopic="Form1"
ScaleHeight =2205
ScaleWidth =6120
StartUpPosition =3 'Windows Default
Begin VB.Timer Timer1 
 Interval=500
 Left=0
 Top =0
End
Begin VB.Label Label1 
 Alignment=1 'Right Justify
 BackStyle=0 'Transparent
 BeginProperty Font 
 Name="Garamond"
 Size=11.25
 Charset =0
 Weight =400
 Underline=0'False
 Italic =0'False
 Strikethrough=0'False
 EndProperty
 ForeColor=&H0080C0FF&
 Height =255
 Left=840
 TabIndex=0
 Top =840
 Width=4335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'// Let you make scrollable text in a label without moving the label.. its fixed...
'// ----------------
'// Got it from: http://hem.passagen.se/tonek/vb
'// Author : Martin Tonek
'// Date of upload : July/15/1999
'// ----------------
'// Remember that this code only function with the assigned fonts,fontssize and
'// labelwidth. It will look more nicer when using ths font that have a fixed
'// width then a font like arial. Also the labelwidth was set for 41 letters so
'// when changing the font you have to change labelwidth or/and settings for
'// letters.
'//
'// CAUTION!! Change the source code and the code can fail!!
'//
'// AddMezz (c)1998 EzySoft, All rights reserved
Dim s As Integer
Dim dta As String
Private Sub Form_Load()
'// Centering the form
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
'// Change Label and Timer prefs
Label1.Caption = ""
Timer1.Enabled = True
Timer1.Interval = 100
Label1.Width = 4335
Label1.Font = "Courier New"
Label1.Font.Size = 9
Label1.Font.Bold = True
End Sub
Private Sub Timer1_Timer()
'// put your text here in dta string
dta = "Mr Slade made IT - please visit http://hem.passagen.se/tonek/vb for updates and other avalible sources! (c)1999 Mr Slade" & Space$(41)
s = s + 1
Label1.Caption = Mid(dta, 1, s)
If Len(Label1.Caption) >= 42 Then Label1.Caption = Right(Label1.Caption, 41)
If s = Len(dta) Then
Label1.Caption = ""
s = 0
End If
End Sub


Other 6 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/11/1999 9:00:00 AMCooL

Neat and CooL.
(If this comment was disrespectful, please report it.)

 
8/26/1999 2:38:00 AMErik

what i need is were i am typing now
if the textbox is full the scrollbar most scroll automatic

i realy need this thanks
erik
(If this comment was disrespectful, please report it.)

 
10/2/1999 3:36:00 PMl


(If this comment was disrespectful, please report it.)

 
10/2/1999 3:40:00 PMl

sub cmdButton_click() sTxt$ = "scrolling label's are cool" do doevents do until iK% = 500 doevents iK% = iK% + 1 loop sTxt$ = right$(stxt$,len(sTxt$)-1) & left$(sTxt$,1) text1.text = sTxt$ end sub
(If this comment was disrespectful, please report it.)

 
2/29/2000 8:23:21 AMjerry

slick piece of work !!!!!!!,way to go!!!!!!
(If this comment was disrespectful, please report it.)

 
6/7/2000 8:44:58 PM\/îÞè® Tè¢.

I cleaned this up and put it in one of my projects (with credit, of coarse)
(If this comment was disrespectful, please report it.)

 
8/26/2000 9:55:49 PMMichael Briggs

Whoa dude great code! hey i made it so it scrolls the forms caption heres the code

dta = "PUT YOU'R MESSAGE HERE" & Space$(41)
s = s + 1
frmEdit.Caption = Mid(dta, 1, s)
If Len(frmEdit.Caption) >= 42 Then frmEdit.Caption = Right(frmEdit.Caption, 41)


If s = Len(dta) Then
frmEdit.Caption = ""
s = 0
End If

just rename the frmEdit to you'r form name than's for that code it's great best text effect ive ever saw!
(If this comment was disrespectful, please report it.)

 
6/14/2001 11:16:17 AMMe!

Simple peice of code made complex. Well, I've been known to do it too... but live and learn!
(If this comment was disrespectful, please report it.)

 
7/30/2001 5:19:30 PMDarek Dumon

Can anyone help me to get a label to scroll DOWN | using the VScrollBar??
V
If anyone can help please put a comment here ore e-mail me (Shoalinwestsider@hotmail.com) thanx
(If this comment was disrespectful, please report it.)

 
9/27/2001 1:06:04 AMeagle4

hey, how would i edit this code so i can have 2 alternating messages, like it types 'hello' and then erases it, then types 'welcome' and then erases it, going back and forth?? if ya can help me, e-mail me this bit of code at wedgetaileagle@yahoo.com
thanx
(If this comment was disrespectful, please report it.)

 
9/27/2001 1:07:30 AMeagle4

hey, how do i make it so it has 2 alternating messages, eg, it types 'hello' then it erases it ans types 'welcome' ??? please e-mail me at wedgetaileagle@yahoo.com is you can help me
thanx
(If this comment was disrespectful, please report it.)

 
6/17/2002 11:26:30 AMBrain

to eagle4, just use a timer set for about 1000 to 2500, depending on how fast you want it to go. Then in your program make a flag, like:
Private Flag1 as integer
'then in the timer do:
if Flag1=0 then
label1.caption="Hello"
Flag1=1
elseif Flag1=1 then
label1.caption="Welcome"
Flag1=0
end if
(If this comment was disrespectful, please report it.)

 
7/25/2002 9:22:04 AMMichiel Schermer

How does this code works if i have 10 spaces after eachother? - then the LEN(42) wouldnt work like in your code... no, what you have to do is set the LABEL.AUTOSIZE to false...then give it a big width, THEN change the caption to any you want, and set the AUTOSIZE to TRUE again.. Then keep stripping of the last character and refrehs the label till the width will become smaller then a certain ammount you defined... its hard to explain but easy to program
(If this comment was disrespectful, please report it.)

 
6/9/2003 3:24:00 AMGregory Propst

I had to fix it so it would work, but I like it.
(If this comment was disrespectful, please report it.)

 
6/23/2003 6:41:12 PMJohn David Whitehouse

looks good
(If this comment was disrespectful, please report it.)

 
8/5/2004 4:16:07 PMNoor Khazal

ReSubmittion :)
(If this comment was disrespectful, please report it.)

 
9/12/2004 7:43:25 PM

yo dis could of been done alot better =)) But if any programers wanna talk to me my yahoo name is lll_encrypted_420_lll but over all its a ight code
(If this comment was disrespectful, please report it.)

 
5/7/2006 7:30:21 AMOmolade

Good of u Keep it up.
pls, How can i Saved checked data from treeview control in database.
Thanks
(If this comment was disrespectful, please report it.)

 
8/25/2006 10:19:15 AMwwwaee

its very good
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.