|
-
Aug 16th, 2000, 09:01 AM
#1
Thread Starter
New Member
Hi,
Bit of a dumb question, Can you add vertical and horizotal scroll bars to scroll through text in a label?
Cheers
-
Aug 16th, 2000, 09:06 AM
#2
Frenzied Member
awkward maybe
horizontal
assign the max value of the bar to equal, say, the number of characters in the caption. Then assign the caption to a string at Form_Load make a second string of x characters long and make that the new caption of the label. On the scroll change event, use a Mid statement to extract the x number of characters from within the original label from character x to character x + (?) . That will make x number of characters show on the label and each click on the scrollbar will make the first disappear and the next in line appear at the end.
Is that anything close to what you mean?
-
Aug 16th, 2000, 09:17 AM
#3
Frenzied Member
sorry. that was a bit vague. I just did one. Here is my code, with only a Label and a Horizontal Scroll:
Dim strWholeText As String, strSegment As String
Dim intPlaceNumber As Integer
Private Sub Form_Load()
strWholeText = "Four Score and Seven Years ago..."
HScroll1.Max = Len(strWholeText)
strSegment = "Four "
Label1.Caption = strSegment
End Sub
Private Sub HScroll1_Change()
Label1.Caption = Mid(strWholeText, HScroll1.Value, 4)
End Sub
-
Aug 16th, 2000, 12:22 PM
#4
Thread Starter
New Member
Thanks,
That should do the trick
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
|