Hi,
Bit of a dumb question, Can you add vertical and horizotal scroll bars to scroll through text in a label?
Cheers
Printable View
Hi,
Bit of a dumb question, Can you add vertical and horizotal scroll bars to scroll through text in a label?
Cheers
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?
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
Thanks,
That should do the trick