Solved

Scrolling text up/down in a text box

Posted on 1998-08-29
2
175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

623 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