Click here to Skip to main content
15,896,111 members
Articles / Desktop Programming / Windows Forms

i00 Spell Check and Control Extensions - No Third Party Components Required!

Rate me:
Please Sign up or sign in to vote.
4.95/5 (117 votes)
11 Jan 2014Ms-PL16 min read 1.4M   22   266  
Simple to use, open source Spell Checker for .NET
<System.ComponentModel.DesignerCategory("")> _
Public Class tsiProgress
    Inherits ToolStripDropDownItem

    Public Overrides ReadOnly Property HasDropDownItems() As Boolean
        Get
            Return True
        End Get
    End Property

    Public Sub New()
        MyBase.AutoSize = False
        MyBase.Height = 10
        MyBase.Width = 100
    End Sub

    Private Sub tsiProgress_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim rect As New Rectangle(0, 0, Me.Width - 1, Me.Height - 1)
        If System.Windows.Forms.ProgressBarRenderer.IsSupported Then
            System.Windows.Forms.ProgressBarRenderer.DrawHorizontalBar(e.Graphics, rect)
        Else
            Using p As New Pen(Color.FromKnownColor(KnownColor.ControlDark))
                e.Graphics.DrawRectangle(p, rect)
            End Using
        End If

        Dim ScrollMargin As Integer = 2

        rect.X += ScrollMargin
        rect.Y += ScrollMargin
        rect.Width -= ScrollMargin * 2
        rect.Height -= ScrollMargin * 2

        rect = New Rectangle(rect.X, rect.Y, CInt(rect.Width * mc_Progress), rect.Height)

        If System.Windows.Forms.ProgressBarRenderer.IsSupported Then
            System.Windows.Forms.ProgressBarRenderer.DrawHorizontalChunks(e.Graphics, rect)
        Else
            Using sb As New SolidBrush(Color.FromKnownColor(KnownColor.Highlight))
                e.Graphics.FillRectangle(sb, rect)
            End Using
        End If

    End Sub

    Dim mc_Progress As Single
    Public Property Progress() As Single
        Get
            Return mc_Progress
        End Get
        Set(ByVal value As Single)
            If mc_Progress <> value Then
                mc_Progress = value
                Me.Invalidate()
            End If
        End Set
    End Property

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 Microsoft Public License (Ms-PL)


Written By
i00
Software Developer (Senior) i00 Productions
Australia Australia
I hope you enjoy my code. It's yours to use for free, but if you do wish to say thank you then a donation is always appreciated.
You can donate here.

Comments and Discussions