Private Sub SetupWindow()
Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
Gr = Me.CreateGraphics()
X = Me.Width
Me.BorderStyle = Windows.Forms.BorderStyle.Fixed3D
Me.Dock = DockStyle.Bottom
_strSize = Gr.MeasureString(_news, Me.Font)
If (Me.Height < _strSize.Height + 4) Then Me.Height = CInt(_strSize.Height) + 4
Timer.Interval = 25
Timer.Start()
End Sub
Private Sub UpdateDisplay()
Dim tHeight As Double = _strSize.Height
Select Case Me.TextPosition
Case TextPlacement.Top : Y = 0
Case TextPlacement.Middle : Y = CSng((Me.Height / 2) - (tHeight / 2))
Case TextPlacement.Bottom : Y = CSng(Me.Height - tHeight)
End Select
Gr.Clear(Me.BackColor)
TextRenderer.DrawText(Gr, _news, Me.Font, New Point(CInt(X), CInt(Y)), Me.ForeColor)
If X <= (0 - _strSize.Width) Then
X = Me.Width
Else
X = CSng(X - _speed)
End If
End Sub