由于先前的答案似乎不适用于“视觉样式”。您可能需要创建自己的类或扩展进度栏:
public class NewProgressBar : ProgressBar{ public NewProgressBar() { this.SetStyle(ControlStyles.UserPaint, true); } protected override void onPaint(PaintEventArgs e) { Rectangle rec = e.ClipRectangle; rec.Width = (int)(rec.Width * ((double)Value / Maximum)) - 4; if(ProgressBarRenderer.IsSupported)ProgressBarRenderer.DrawHorizontalBar(e.Graphics, e.ClipRectangle); rec.Height = rec.Height - 4; e.Graphics.FillRectangle(Brushes.Red, 2, 2, rec.Width, rec.Height); }}编辑:更新的代码以使进度条使用背景的视觉样式



