Solved

Scrolling text up/down in a text box

Posted on 1998-08-29
2
173 Views
Last Modified: 2008-02-26
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
Comment
Question by:smithgr
2 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1431772
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
 
LVL 1

Author Comment

by:smithgr
ID: 1431773
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run code from text file in vb 1 84
Access query that references subform 5 48
Looking for VB6 code to read SQL table export it to ascii 8 47
Hide vba in gp 7 113
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question