Click here to Skip to main content
15,887,371 members
Articles / Multimedia / GDI+

Analog Clock Control

Rate me:
Please Sign up or sign in to vote.
4.58/5 (66 votes)
23 Jan 2010CPOL4 min read 319.1K   30.7K   138  
The analog clock control is a control that has almost all the functionality that a clock control can have, and it is fully modifiable.
''' <summary>
''' Provides data for the
''' AnalogClock.Clock.SymbolsPainting events.
''' </summary>
<DebuggerNonUserCode()> _
Public Class PaintEventArgs
    Inherits System.Windows.Forms.PaintEventArgs

#Region " Members "

    Private _brush As Brush

#End Region

#Region " Properties "

    ''' <summary>
    ''' Gets or sets the brush object that is used to fill the interior of the element.
    ''' </summary>
    Public Property Brush() As Brush
        Get
            Return Me._brush
        End Get
        Set(ByVal value As Brush)
            If value IsNot Nothing Then
                Me._brush = CType(value.Clone, Drawing.Brush)
            End If
        End Set
    End Property

#End Region

#Region " Methods "

    ''' <param name="graphics">The System.Drawing.Graphics used to paint the item.</param>
    ''' <param name="clipRectangle">The System.Drawing.Rectangle that represents the rectangle in which to paint.</param>
    Sub New(ByVal graphics As System.Drawing.Graphics, ByVal clipRectangle As System.Drawing.Rectangle)
        MyBase.New(graphics, clipRectangle)
    End Sub

    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso Me._brush IsNot Nothing Then
                Me._brush.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

#End Region

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) ZipEdTech
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions