Click here to Skip to main content
15,886,799 members
Articles / Programming Languages / C# 4.0

EasyProgressBar for Windows Forms Application

Rate me:
Please Sign up or sign in to vote.
4.96/5 (54 votes)
8 Jun 2011CPOL20 min read 101.7K   9.4K   104  
This article discusses how to create a simple ProgressBar control for the Windows Forms Application using the .NET Framework.
using System;
using System.Drawing;

namespace EasyProgressBar
{
    public interface IProgressBar
    {
        /// <summary>
        /// Gets or Sets, the current progress value of the control.
        /// </summary>
        int Value { get; set; }

        /// <summary>
        /// Gets or Sets, the minimum progress value of the control.
        /// </summary>
        int Minimum { get; set; }

        /// <summary>
        /// Gets or Sets, the maximum progress value of the control.
        /// </summary>
        int Maximum { get; set; }

        /// <summary>
        /// Determines whether the control's border is draw or not.
        /// </summary>
        bool IsPaintBorder { get; set; }

        /// <summary>
        /// Determines whether the digital number drawing is enabled or not.
        /// </summary>
        bool IsDigitDrawEnabled { get; set; }

        /// <summary>
        /// Determines whether the percentage text is show or hide.
        /// </summary>
        bool ShowPercentage { get; set; }

        /// <summary>
        /// Display text formatting for progressbar value.
        /// </summary>
        string DisplayFormat { get; set; }

        /// <summary>
        /// Gets or Sets, the control's border color from here.
        /// </summary>
        Color BorderColor { get; set; }
        
        /// <summary>
        /// Gets or Sets, the current border style of the ProgressBar control.
        /// </summary>
        EasyProgressBarBorderStyle ControlBorderStyle { get; set; }

        /// <summary>
        /// Occurs when the progress value changed of the control.
        /// </summary>
        event EventHandler ValueChanged;
    }
}

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) ARELTEK
Turkey Turkey
Since 1998...

MCPD - Enterprise Application Developer

“Hesaplı hareket ettiğini zanneden ve onunla iftihar eyliyen dar kafalar; kurtulmağa, yükselmeğe elverişli hiç bir eser vücüda getirmezler. Kurtuluş ve yükselişi, ancak varlığına dayanan ve mülkü milletin gizli kapalı hazinelerini verimli hale getirmesini bilen, şahsi menfaatini millet menfaati uğruna feda eden, ruhu idealist, dimağı realist şahsiyetlerde aramalıdır.”

Nuri Demirağ, 1947

Comments and Discussions