|
-
Nov 13th, 2000, 03:51 AM
#1
Thread Starter
Lively Member
Hello,
Does anybody know how I can scroll a string in a single line of a Label or TextBox or StatusBar panel ?
Thank you,
Thierry
-
Nov 13th, 2000, 04:52 AM
#2
In Textbox, you can control scrollbars with a property (scrollbars something). Just look at properties window at design time.
-
Nov 13th, 2000, 05:12 AM
#3
Thread Starter
Lively Member
This is not what I want !
In fact, I want it to scroll automatically and continously as a message.
Thanks
-
Nov 13th, 2000, 05:41 AM
#4
Ah...Then maybe the simplest way is to put autosized label in a picturebox with BorderStyle of 0. Then just with a timer you get a scroll in it easily.
Code:
Dim lblLeft As Integer
Private Sub Timer1_Timer()
lblLeft = lblLeft - 15
If lblLeft <= -Label1.Width Then lblLeft = Picture1.ScaleWidth
Label1.Move lblLeft, 0
End Sub
Sorry, having a bad headache at the moment...Hope I got it right now.
-
Nov 13th, 2000, 05:50 AM
#5
You can also try scrolling with textbox by changing it's SelStart value. It's not smooth if I remember right.
-
Nov 13th, 2000, 07:16 AM
#6
_______
<?>
Code:
'scrolling text
'need 1 label, 1 timer, 1 command button for this example
'
Option Explicit
Private Sub Command1_Click()
'will give user a Yes or No prompt in which they wish to exit
Dim x As Integer
x = MsgBox("Are you sure you want to exit?", vbYesNo, "Exit")
If x = 6 Then
End
End If
End Sub
Private Sub Form_Load()
'Will modify all the following controls when the project is run o
' r loaded
dim msg$ as string
msg$ = "This is a simple Marquee example that I've made." & vbCrLf
msg$ = msg$ & "You can make something 100 times better."
MsgBox msg$, vbYes, "Marquee Example of Scrolling Text"
Label1.Visible = True
Label1.Enabled = True
Form1.Enabled = True
Label1.Caption = Date
Label1.Left = 0
Label1.Top = 1800
Label1.Height = 255
Label1.Width = 1195
Command1.Top = 2400
Command1.Left = 0
Command1.Height = 375
Command1.Width = 6705
Command1.Caption = "Exit Example"
Command1.Enabled = True
Command1.Visible = True
Form1.Height = 3225
Form1.Width = 6810
Timer1.Enabled = True
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
If Label1.Left < -1000 Then
Label1.Left = 7000
Else
Label1.Left = Val(Label1.Left) - 40
End If
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 13th, 2000, 07:51 AM
#7
Thread Starter
Lively Member
Thanks for all...
Thanks for your replies.
I used a Timer control as follow :
Private Sub Timer_Timer()
k = k + 1
Label1.Caption = Left(lib, k)
If k = Len(lib) Then k = 0
End Sub
And it works fine !...
Thierry
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
|