Solved

Scrolling text up/down in a text box

Posted on 1998-08-29
2
171 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb script Microsoft Word tables portion of based on bookmark, count and add rows 1 55
Visual Studio 2005 text editor 10 38
Child Form in front 4 46
Advice in Xamarin 21 78
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now