VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Smooth Scrolling"
   ClientHeight    =   4530
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   14505
   LinkTopic       =   "Form1"
   ScaleHeight     =   4530
   ScaleWidth      =   14505
   StartUpPosition =   3  'Windows Default
   Begin VB.PictureBox Picture2 
      Height          =   615
      Left            =   480
      ScaleHeight     =   555
      ScaleWidth      =   6195
      TabIndex        =   2
      Top             =   3480
      Width           =   6255
   End
   Begin VB.Timer Timer1 
      Interval        =   10
      Left            =   6360
      Top             =   600
   End
   Begin VB.PictureBox Picture1 
      BeginProperty Font 
         Name            =   "Microsoft Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   7080
      ScaleHeight     =   555
      ScaleWidth      =   6195
      TabIndex        =   0
      Top             =   3480
      Width           =   6255
      Begin VB.Label Label1 
         Caption         =   "Make this text scroll without a flicker"
         BeginProperty Font 
            Name            =   "Microsoft Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   1
         Top             =   120
         Width           =   3855
      End
   End
   Begin VB.Label Label3 
      Caption         =   "BitBlting gets rid of the flicker"
      Height          =   255
      Left            =   480
      TabIndex        =   4
      Top             =   3240
      Width           =   2295
   End
   Begin VB.Label Label2 
      Caption         =   "This text will flicker"
      Height          =   255
      Left            =   7080
      TabIndex        =   3
      Top             =   3240
      Width           =   1695
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
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
Private Const SRCCOPY = &HCC0020

Private Sub Form_Load()
Me.Picture1.AutoRedraw = True
Me.Picture2.AutoRedraw = False
Me.Label1.Visible = False
' Change the font by changing the picture box 1 font
' move the label in picture box 1 up or down to position your text
End Sub

Private Sub Timer1_Timer()
    Label1.Move Label1.Left - 20 ' move the label to the left for scrolling effect
    If Label1.Left < -Picture1.Width Then Label1.Left = Picture1.Width
    Me.Picture1.Cls ' after cls currenty and currentx and currenty are set to 0
    Me.Picture1.CurrentY = Me.Label1.Top ' use the label coordinates to set Y printing position
    Me.Picture1.CurrentX = Me.Label1.Left ' use the label coordinates to set the X printing position
    Me.Picture1.Print Me.Label1.Caption ' print the label text on to the picture box
    BitBlt Picture2.hDC, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hDC, 0, 0, SRCCOPY 'bitblt picture1 to picture2
End Sub
