Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

Scrolling text up/down in a text box

I'd like to make a scrolling marquee type of about box but am lost when it comes to scrolling text in a vertical motion and then refreshing it self and starting over again once the message as scrolled...ideas please. Thanks
0
smithgr
Asked:
smithgr
1 Solution
 
MikeP090797Commented:
Do something like this:

1. Add 5-7 blank lines into the edit box before the text, so it will show only the first line at the bottom of it, and then 5-6 blank lines after the text, so only 1 line will be shown at the top

2. Put this in a module:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const EM_SCROLL = &HB5
Public Const SB_LINEDOWN = 1
Public Const SB_LINEUP = 0


3. Create a timer with the interval set to 300-500, depending on the size of the text


4.Put this in Timer1_Timer

Static N1 as integer
Dim I as integer
If N1='NumberOfLines  then
For I = 1 to 'NumberofLines
 SendMessage Text1.hwnd, EM_SCROLL, SB_LINEUP, 0
Next I
N1=0
End If


N1=N1+1
SendMessage Text1.hwnd, EM_SCROLL, SB_LINEDOWN, 0


Tell me if there are any problems

0
 
smithgrAuthor Commented:
Mike,

Thanks - I tried your suggestion but I didnt like the jumping of lines so what I did was to place a picture within a picture and place a label on that inner picture, I then scroll the inner picture within the outer picture which makes for smooth scrolling of the text - pictures and anything else placed on it. Thanks - your answer helped put me in the right direction.

Gary

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now