Source/Controls/ProgressBarX.cs

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;

namespace DevComponents.DotNetBar.Controls
{
    /// <summary>
    /// Represents the stand-alone progress bar control.
    /// </summary>
    [ToolboxBitmap(typeof(ProgressBarX), "Controls.ProgressBarX.ico"), ToolboxItem(true), DefaultEvent("Click"), System.Runtime.InteropServices.ComVisible(false)]
    public class ProgressBarX : BaseItemControl
    {
        #region Private Variables
        private ProgressBarItem m_ProgressBar = null;
        #endregion

        #region Constructor, Dispose
        public ProgressBarX()
        {
            m_ProgressBar = new ProgressBarItem();
            m_ProgressBar.Style = eDotNetBarStyle.Office2007;
            m_ProgressBar.Minimum = 0;
            m_ProgressBar.Maximum = 100;
            m_ProgressBar.Value = 0;
            m_ProgressBar.BackStyle = this.BackgroundStyle;

            this.HostItem = m_ProgressBar;
        }
        #endregion

        #region Internal Implementation
        protected override void PaintBackground(PaintEventArgs e)
        {
            // ProgressBarItem shares same background style as control so it will paint itself. This avoids double painting...
            Graphics g = e.Graphics;
            Rectangle r = this.ClientRectangle;
            ElementStyle style = this.GetBackgroundStyle();

            if ((!style.Custom || style.BackColor.IsEmpty)&& !this.BackColor.IsEmpty && this.BackColor!=Color.Transparent)
            {
                DisplayHelp.FillRectangle(g, r, this.BackColor);
            }
        }

        /// <summary>
        /// Gets or sets the maximum value of the range of the control.
        /// </summary>
        [Browsable(true), Description("Gets or sets the maximum value of the range of the control."), Category("Behavior"), DefaultValue(100)]
        public int Maximum
        {
            get
            {
                return m_ProgressBar.Maximum;
            }
            set
            {
                m_ProgressBar.Maximum = value;
            }
后面还有 219 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。