VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Picturebox Scroller

Paul Wheeler  (1 Submission)   Graphics   Visual Basic 3.0   Beginner   Wed 3rd February 2021

This is a simple function which smoothly scrolls text in a picturebox. Unlike other entries it only needs one picturebox. Each time the function is called it adds the text to the bottom (or top) of the picturebox and scrolls the rest of the box (without moving the box itself). Used with a timer control it creates a very versatile scrolling routine. It can easily be modified to scroll anything that has an HDC. The font property on the picturebox controls the look of the text. BitBlt api based on code submitted by MO. I used this code for a phone tracking program than needed to constantly scroll incoming call data in a picturebox.

Inputs
a PictureBox control, some text and the direction

Assumes
Simply add a picturebox called picture1 and a timer called timer1 to a form and paste the code into the form's code module. The timer.interval changes the speed of the scrolling (of course).

API Declarations
Private Declare Function BitBlt Lib "GDI32" (ByVal hDestDC As Long, ByVal x As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long

Rate Picturebox Scroller (3(3 Vote))
Picturebox Scroller.bas

Picturebox Scroller Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters