Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class ScrollingLabel
- Inherits Label
- Private _highlight As Integer
- Private _backcolor As Color = Color.Blue
- Private _forecolor As Color = Color.Yellow
- Public Property Highlight() As Integer
- Get
- Return _highlight
- End Get
- Set(ByVal value As Integer)
- _highlight = value
- Invalidate()
- End Set
- End Property
- Public Property BackText As Color
- Get
- Return _backcolor
- End Get
- Set(ByVal value As Color)
- _backcolor = value
- Invalidate()
- End Set
- End Property
- Public Property HightlightText As Color
- Get
- Return _forecolor
- End Get
- Set(ByVal value As Color)
- _forecolor = value
- Invalidate()
- End Set
- End Property
- Protected Overrides Sub OnPaint(e As PaintEventArgs)
- MyBase.OnPaint(e)
- Dim G As Graphics = e.Graphics
- G.Clear(BackColor)
- G.DrawString(Text, Font, New SolidBrush(_backcolor), 0, 0)
- G.DrawString(Text.Substring(0, _highlight), Font, New SolidBrush(_forecolor), 0, 0)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement