默认是横的进度。如何改成向上的进度?请指教

解决方案 »

  1.   

    垂直方向的 ProgressBar .ProgressBarRenderer 
    http://msdn.microsoft.com/zh-cn/library/system.windows.forms.progressbar(VS.80).aspx
      

  2.   

    好吧 打个比方 一个用绘图法制作的
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;using System.Drawing.Drawing2D;
    using System.Drawing.Imaging;
    using System.IO;namespace test
    {
        public partial class UpPro : UserControl
        {
            private int _Value;
            private Image b;
            public int Width { get; set; }
            public int Height { get; set; }
            public int MaxValue { get; set; }
            public int Value
            {
                get {
                    return _Value;
                }
                set {
                    this._Value = value;
                    SetValue();
                }
            }
            public UpPro()
            {
                InitializeComponent();
            }
            public UpPro(int width, int height)
                : this()
            {
                this.Width = width;
                this.Height = height;
            }        private void UpPro_Load(object sender, EventArgs e)
            {
                this.Size = new Size { Width = this.Width, Height = this.Height };
                b = new Bitmap(this.Width, this.Height, PixelFormat.Format24bppRgb);
                // 将PictureBox Dock设为Fill以自适应宽高
                Bar.Dock = DockStyle.Fill;
            }        private void SetValue()
            {
                int BarHeight = 进度条进度部分高度 根据_Value和MaxValue按比例计算;
                int BarWidth = 进度条进度部分宽度 想显示的高度;
                
                using (Graphics g = Graphics.FromImage(b))
                {
                    // 绘制进度条
                      g.FillRectangle( new SolidBrush(Color.Black), x坐标,y坐标,宽度,高度 );
                    // 将图象写入PictureBox
                    Bar.Image = b;
                }
            }
        }
    }//调用
    UpPro up = new UpPro(40,100);
    up.MaxValue = 100;
    up.Value = 50;
      

  3.   

    楼主,自己画一个using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows.Forms;namespace Toncent.Control
    {
        /// <summary>
        /// 垂直进度条
        /// </summary>
        public class ProgressBarVertical : ProgressBar
        {
            const int PBS_VERTICAL = 4;        protected override CreateParams CreateParams
            {
                get
                {
                    CreateParams cp = base.CreateParams;
                    cp.Style |= PBS_VERTICAL;
                    return cp;
                }
            }
        } }
    声明:非原创,非常对不起原作者,没有记录原作者相关信息
    在此顺便向原作者至敬。
      

  4.   


    不用搬显示器也能转,大家试试这种方法:桌面 --> 右键菜单 --> 图形选项  --> 旋转 --> 90度
      

  5.   

    来自网上class ProgressBarVertical : ProgressBar
        {
            const int PBS_VERTICAL = 4;
            
            //重载 CreateParams 属性
            protected override CreateParams CreateParams
            {
                get
                {
                    CreateParams cp = base.CreateParams;
                    cp.Style |= PBS_VERTICAL;
                    return cp;
                }
            }
        }   
      

  6.   

    控件System.Windows.Forms.ProcessBar只能水平显示其进度。但是其封装的Win32控件同时还支持垂直显示。以下的代码提供了实现的示例。
      

  7.   

    ProgressBar .ProgressBarRenderer 
    我晕~~
      

  8.   

    .NET提供的那个不提供这种功能吧,
    要不用第三方控件,要不自己做个自定义控件,要不把脸横过来看屏幕!
      

  9.   

    在MSDN中查ProgressBarRenderer.DrawVerticalBar 方法  绘制一个垂直填充的空白进度栏控件。
    楼主可以看看!