コード例 #1
0
ファイル: FormMain.cs プロジェクト: JedBurke/DMR11
        void InitializeNetworkProgressBar()
        {
            NetworkProgressBar = new FlatProgressBar();

            NetworkProgressBar.Dock          = DockStyle.Top;
            NetworkProgressBar.Height        = 3;
            NetworkProgressBar.ProgressColor = ControlPaint.Dark(Color.SlateGray, 0.15f);
        }
コード例 #2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (foreground == null && progress != null)
         {
             progress.Dispose();
             progress = null;
         }
     }
     base.Dispose(disposing);
 }
コード例 #3
0
        public formProgressOverlay(formProgressOverlay background)
        {
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.Opacity         = 0.95;
            this.TransparencyKey = this.BackColor = Color.Magenta;
            this.ShowInTaskbar   = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.StartPosition   = FormStartPosition.Manual;

            progress = new FlatProgressBar()
            {
                Anchor    = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top,
                Bounds    = this.ClientRectangle,
                ForeColor = Color.LimeGreen,
                Animated  = true,
            };

            this.Controls.Add(progress);
        }
コード例 #4
0
ファイル: BasicExample.cs プロジェクト: SuicideSin/FlatUI
        private void FlatButton_Click(object sender, EventArgs e)
        {
            if (!_progressOngoing)
            {
                var sleepAmount = ProgressCheckBox.Checked ? 30 : 10;

                _progressOngoing      = true;
                FlatProgressBar.Value = 0;

                new Thread(() =>
                {
                    while (FlatProgressBar.Value < FlatProgressBar.Maximum)
                    {
                        Thread.Sleep(sleepAmount);
                        Invoke((MethodInvoker)(() => FlatProgressBar.Increment(1)));
                    }

                    _progressOngoing = false;
                }).Start();
            }
        }
コード例 #5
0
        public formProgressOverlay()
        {
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.Opaque, true);

            this.Opacity         = 0.75;
            this.BackColor       = Color.Black;
            this.ShowInTaskbar   = false;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.StartPosition   = FormStartPosition.Manual;

            this.Paint += background_Paint;

            foreground       = new formProgressOverlay(this);
            foreground.Owner = this;

            progress = foreground.progress;

            this.MinimumSizeChanged += background_MinimumSizeChanged;
            this.MaximumSizeChanged += background_MaximumSizeChanged;

            this.Size = new Size(200, 7);
        }
コード例 #6
0
    public void Increment(int Amount)
    {
        FlatProgressBar value = this;

        value.Value = value.Value + Amount;
    }