/// <summary> /// 覆盖系统进度条 /// </summary> /// <param name="bar">自定义进度条</param> /// <param name="container">容器进度条</param> /// <param name="value">进度条显示值</param> private void ChangeColor(MyProgressBar bar, ProgressBar container) { bar.Parent = container; bar.Minimum = 0; //进度条显示最小值 bar.Maximum = 100; //进度条显示最大值 bar.Width = container.Width; bar.Height = container.Height; bar.BackColor = Color.FromArgb(252, 71, 71); }
private void InitProgressBar() { BarPLC = new MyProgressBar(); BarSQL = new MyProgressBar(); ChangeColor(BarPLC, progressBarPLC); ChangeColor(BarSQL, progressBarSQL); }