当前位置: 首页>>代码示例>>C#>>正文


C# Forms.ProgressBar类代码示例

本文整理汇总了C#中System.Windows.Forms.ProgressBar的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar类的具体用法?C# ProgressBar怎么用?C# ProgressBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProgressBar类属于System.Windows.Forms命名空间,在下文中一共展示了ProgressBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.StartupPanel = new System.Windows.Forms.Panel();
     this.OdeoLogo = new System.Windows.Forms.PictureBox();
     this.ProgressMeter = new System.Windows.Forms.ProgressBar();
     //
     // StartupPanel
     //
     this.StartupPanel.Controls.Add(this.ProgressMeter);
     this.StartupPanel.Controls.Add(this.OdeoLogo);
     this.StartupPanel.Location = new System.Drawing.Point(0, 3);
     this.StartupPanel.Size = new System.Drawing.Size(176, 194);
     //
     // OdeoLogo
     //
     this.OdeoLogo.Location = new System.Drawing.Point(42, 49);
     this.OdeoLogo.Size = new System.Drawing.Size(92, 39);
     //
     // ProgressMeter
     //
     this.ProgressMeter.Location = new System.Drawing.Point(42, 94);
     this.ProgressMeter.Size = new System.Drawing.Size(92, 6);
     //
     // FrmStartup
     //
     this.ClientSize = new System.Drawing.Size(176, 200);
     this.Controls.Add(this.StartupPanel);
     this.Text = "Odeo Syncr";
 }
开发者ID:matthiase,项目名称:odeo-mobile,代码行数:33,代码来源:FrmStartup.cs

示例2: NotificationPanel

 /// <summary>
 /// Creates a new control instance.
 /// </summary>
 public NotificationPanel()
 {
     this.progressBar = new ProgressBar();
     this.labelProgress = new Label();
     this.pictureProgress = new PictureBox();
     ((System.ComponentModel.ISupportInitialize)(this.pictureProgress)).BeginInit();
     this.SuspendLayout();
     // progressBar
     this.progressBar.Location = new Point(62, 40);
     this.progressBar.Size = new Size(730, 16);
     this.progressBar.TabIndex = 1;
     this.progressBar.Visible = false;
     // labelProgress
     this.labelProgress.Location = new Point(62, 8);
     this.labelProgress.Size = new Size(730, 29);
     this.labelProgress.TabIndex = 0;
     this.labelProgress.TextAlign = ContentAlignment.MiddleLeft;
     // pictureProgress
     this.pictureProgress.Location = new Point(8, 8);
     this.pictureProgress.Size = new Size(48, 48);
     this.pictureProgress.TabIndex = 3;
     this.pictureProgress.TabStop = false;
     // Control.
     this.AutoScaleDimensions = new SizeF(6F, 13F);
     this.AutoScaleMode = AutoScaleMode.Font;
     this.Controls.Add(this.progressBar);
     this.Controls.Add(this.labelProgress);
     this.Controls.Add(this.pictureProgress);
     this.MaximumSize = new Size(0, 64);
     this.MinimumSize = new Size(0, 64);
     this.Size = new Size(800, 64);
     ((System.ComponentModel.ISupportInitialize)(this.pictureProgress)).EndInit();
     this.ResumeLayout(false);
 }
开发者ID:alexbikfalvi,项目名称:DotNetApi,代码行数:37,代码来源:NotificationPanel.cs

示例3: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DlgInitProgress));
     this.progressBar = new System.Windows.Forms.ProgressBar();
     this.SuspendLayout();
     //
     // progressBar
     //
     this.progressBar.Location = new System.Drawing.Point(12, 38);
     this.progressBar.Name = "progressBar";
     this.progressBar.Size = new System.Drawing.Size(328, 24);
     this.progressBar.TabIndex = 3;
     //
     // DlgInitProgress
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(352, 101);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                   this.progressBar});
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "DlgInitProgress";
     this.ShowInTaskbar = false;
     this.Text = "Initializing New Language.  Please Wait...";
     this.ResumeLayout(false);
 }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:31,代码来源:DlgInitProgress.cs

示例4: FrmLogin_Load

        private void FrmLogin_Load(object sender, EventArgs e)
        {
            Image img = CKGen.Properties.Resources.link;
            Bitmap myBitmap = new Bitmap(img);
            Icon myIcon = Icon.FromHandle(myBitmap.GetHicon());
            this.Icon = myIcon;

            this.bar = new ProgressBar();
            this.bar.Location = new System.Drawing.Point(18, 0);
            this.bar.Size = new System.Drawing.Size(367, 10);
            this.bar.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
            this.bar.Visible = false;
            this.Controls.Add(bar);

            this.cbServerType.DataSource = typeof(DatabaseType).ToList();
            this.cbServerType.DisplayMember = "Value";
            this.cbServerType.ValueMember = "Key";

            this.btnOK.Enabled = false;

            var connList = ConnectionSetting.GetList();
            if (connList != null && connList.Count > 0)
            {
                cbServerName.DataSource = connList;
                cbServerName.DisplayMember = "ServerName";
                cbServerName.ValueMember = "ServerName";

                ShowServer(connList[0].ServerName);
            }

            this.AcceptButton = this.btnLogin;
        }
开发者ID:zhh007,项目名称:CKGen,代码行数:32,代码来源:FrmLogin.cs

示例5: SetProgressBarState

        public static void SetProgressBarState(ProgressBar progressBar, int state)
        {
            if (progressBar == null)
                throw new ArgumentNullException("progressBar");

            SendMessage(new HandleRef(progressBar, progressBar.Handle), NativeMethods.PBM_SETSTATE, (IntPtr)state, IntPtr.Zero);
        }
开发者ID:netide,项目名称:netide,代码行数:7,代码来源:NativeMethods.cs

示例6: DownloadFile

        //下载网络文件
        /// <summary>
        /// 下载网络文件 带进度条
        /// </summary>
        /// <param name="URL"></param>
        /// <param name="fileName"></param>
        /// <param name="progressBar1"></param>
        /// <returns></returns>
        public static bool DownloadFile(string URL, string fileName,ProgressBar progressBar1)
        {
            try
            {
                System.Net.HttpWebRequest httpWebRequest1 = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(URL);
                System.Net.HttpWebResponse httpWebResponse1 = (System.Net.HttpWebResponse)httpWebRequest1.GetResponse();

                long totalLength = httpWebResponse1.ContentLength;
                progressBar1.Maximum = (int)totalLength;

                System.IO.Stream stream1 = httpWebResponse1.GetResponseStream();
                System.IO.Stream stream2 = new System.IO.FileStream(fileName, System.IO.FileMode.Create);

                long currentLength = 0;
                byte[] by = new byte[1024];
                int osize = stream1.Read(by, 0, (int)by.Length);
                while (osize > 0)
                {
                    currentLength = osize + currentLength;
                    stream2.Write(by, 0, osize);

                    progressBar1.Value = (int)currentLength;
                    osize = stream1.Read(by, 0, (int)by.Length);
                }

                stream2.Close();
                stream1.Close();

                return (currentLength == totalLength);
            }
            catch
            {
                return false;
            }
        }
开发者ID:450640526,项目名称:HtmExplorer,代码行数:43,代码来源:HttpClass.cs

示例7: checkClip

 private void checkClip(ProgressBar pb)
 {
     if (pb.ForeColor == SystemColors.ActiveCaption && pb.Value >= pb.Maximum)
         pb.ForeColor = Color.FromArgb(255, 0, 0);
     else if(pb.ForeColor == Color.FromArgb(255, 0, 0))
         pb.ForeColor = SystemColors.ActiveCaption;
 }
开发者ID:JariInc,项目名称:TransducerDriver,代码行数:7,代码来源:TransducerDriver.cs

示例8: UpdateForm

        public UpdateForm()
        {
            this.StartPosition = FormStartPosition.CenterScreen;
            this.ClientSize = new Size(220, 90);
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.ControlBox = false;
            this.ShowInTaskbar = false;

            this.Controls.Add(l_Info = new Label());
            l_Info.Location = new Point(0, 0);
            l_Info.Size = new Size(220, 60);
            l_Info.TextAlign = ContentAlignment.MiddleCenter;
            l_Info.Font = new Font(l_Info.Font.ToString(), 10f);

            ProgressBar p_Status;
            this.Controls.Add(p_Status = new ProgressBar());
            p_Status.Location = new Point(10, 60);
            p_Status.Size = new Size(200, 20);
            p_Status.Style = ProgressBarStyle.Marquee;

            t_Work = new Thread(AppUpdate);
            t_Work.Start();
        }
开发者ID:alexbrain90,项目名称:MediaLoader,代码行数:25,代码来源:UpdateForm.cs

示例9: CombinFile

 /// <summary>
 /// �ϲ��ļ�
 /// </summary>
 /// <param name="list">Ҫ�ϲ����ļ�����</param>
 /// <param name="strPath">�ϲ�����ļ�����</param>
 /// <param name="PBar">��������ʾ</param>
 public void CombinFile(string[] strFile, string strPath, ProgressBar PBar)
 {
     PBar.Maximum = strFile.Length;
     FileStream AddStream = null;
     //�Ժϲ�����ļ����ƺʹ򿪷�ʽ����������ʼ��FileStream�ļ���
     AddStream = new FileStream(strPath, FileMode.Append);
     //��FileStream�ļ�������ʼ��BinaryWriter��д���������Ժϲ��ָ���ļ�
     BinaryWriter AddWriter = new BinaryWriter(AddStream);
     FileStream TempStream = null;
     BinaryReader TempReader = null;
     //ѭ���ϲ�С�ļ��������ɺϲ��ļ�
     for (int i = 0; i < strFile.Length; i++)
     {
         //��С�ļ�����Ӧ���ļ����ƺʹ�ģʽ����ʼ��FileStream�ļ��������ȡ�ָ�����
         TempStream = new FileStream(strFile[i].ToString(), FileMode.Open);
         TempReader = new BinaryReader(TempStream);
         //��ȡ�ָ��ļ��е����ݣ������ɺϲ����ļ�
         AddWriter.Write(TempReader.ReadBytes((int)TempStream.Length));
         //�ر�BinaryReader�ļ��Ķ���
         TempReader.Close();
         //�ر�FileStream�ļ���
         TempStream.Close();
         PBar.Value = i + 1;
     }
     //�ر�BinaryWriter�ļ���д��
     AddWriter.Close();
     //�ر�FileStream�ļ���
     AddStream.Close();
     MessageBox.Show("�ļ��ϲ��ɹ���");
 }
开发者ID:TGHGH,项目名称:C-1200,代码行数:36,代码来源:Frm_Main.cs

示例10: collision

        private void collision(PictureBox player, PictureBox weapon, ProgressBar health, System.Windows.Forms.Timer timer)
        {
            if (weapon.Left > this.Size.Width || weapon.Right < 0)
            {
                timer.Enabled  = false;
                weapon.Visible = false;
            }
            else if ((((weapon.Name == "spear") && (weapon.Right > player.Left + 15 ))
                  || ((weapon.Name == "fez")   && (weapon.Left < player.Right - 15)))
                  &&  (weapon.Bottom > player.Top + 5)
                  &&  (weapon.Top < player.Bottom - 5))
            {
                timer.Enabled  = false;
                weapon.Visible = false;
                health.Value -= 25;
                if (health.Value == 0)
                {
                    disableTimers(false);
                    stopSound();
                    playSound(health.Tag.ToString());
                    leonidas.Location = new Point(leonidas.Location.X, leonidas.Location.Y);
                    MessageBox.Show(weapon.Tag + " wins!");

                    this.Close();
                }
            }
        }
开发者ID:nmonti,项目名称:Sam-vs-Stalin-2,代码行数:27,代码来源:Form1.cs

示例11: EasyMYPProgressBarVisibilityEvent

 public EasyMYPProgressBarVisibilityEvent(ProgressBar pb, bool visible, int maximum, int value)
 {
     this.pb = pb;
     this.visible = visible;
     this.maximum = maximum;
     this.value = value;
 }
开发者ID:Amver,项目名称:easymyp,代码行数:7,代码来源:MainWindow_Delegates_Events.cs

示例12: Display

        public void Display()
        {
            if (Fuben != null && Fuben.Tasks != null)
            {
                if (this.listViewEx1.Items.Count == 0)
                {
                    for (int i = 0; i < Fuben.Tasks.Count; i++)
                    {
                        var item = Fuben.Tasks[i];
                        var lvi = listViewEx1.Items.Add(item.Name);
                        lvi.SubItems.Add("");
                        lvi.SubItems.Add(item.ColdDownDisplay);

                        ProgressBar pb = new ProgressBar();
                        pb.Maximum = item.SumCount;
                        pb.Value = item.Count;
                        listViewEx1.AddEmbeddedControl(pb, 1, i);
                    }
                }
                else
                {
                    for (int i = 0; i < Fuben.Tasks.Count; i++)
                    {
                        var item = Fuben.Tasks[i];
                        var lvi = listViewEx1.Items[i];
                        lvi.SubItems[0].Text = item.Name;
                        lvi.SubItems[2].Text = item.ColdDownDisplay;

                        ProgressBar pb = (ProgressBar)listViewEx1.GetEmbeddedControl(1, i);
                        if (pb.Value != item.Count) pb.Value = item.Count;
                    }
                }
            }
        }
开发者ID:rajeshwarn,项目名称:rasg,代码行数:34,代码来源:FubenGroupStatus.cs

示例13: InitializeComponent

 private void InitializeComponent()
 {
   this.label1 = new Label();
   this.progressBar = new ProgressBar();
   this.SuspendLayout();
   this.label1.Location = new Point(16, 16);
   this.label1.Name = "label1";
   this.label1.Size = new Size(105, 20);
   this.label1.TabIndex = 0;
   this.label1.Text = "Connecting...";
   this.label1.TextAlign = ContentAlignment.MiddleLeft;
   this.progressBar.Location = new Point(16, 40);
   this.progressBar.Name = "progressBar";
   this.progressBar.Size = new Size(236, 16);
   this.progressBar.Style = ProgressBarStyle.Marquee;
   this.progressBar.TabIndex = 1;
   this.AutoScaleDimensions = new SizeF(6f, 13f);
   this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
   this.ClientSize = new Size(271, 69);
   this.ControlBox = false;
   this.Controls.Add((Control) this.progressBar);
   this.Controls.Add((Control) this.label1);
   this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
   this.MaximizeBox = false;
   this.MinimizeBox = false;
   this.Name = "ProviderHelperForm";
   this.ShowIcon = false;
   this.ShowInTaskbar = false;
   this.StartPosition = FormStartPosition.CenterParent;
   this.Text = "ProviderHelperForm";
   this.ResumeLayout(false);
 }
开发者ID:smther,项目名称:FreeOQ,代码行数:32,代码来源:ProviderHelperForm.cs

示例14: InitializeComponent

        private void InitializeComponent()
        {
            this.lbCaption = new System.Windows.Forms.Label();
            this.pbProgress = new System.Windows.Forms.ProgressBar();
            this.SuspendLayout();
            // 
            // lbCaption
            // 
            this.lbCaption.AutoSize = true;
            this.lbCaption.Location = new System.Drawing.Point(3, 0);
            this.lbCaption.Name = "lbCaption";
            this.lbCaption.Size = new System.Drawing.Size(51, 13);
            this.lbCaption.TabIndex = 0;
            this.lbCaption.Text = "lbCaption";
            // 
            // pbProgress
            // 
            this.pbProgress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left)));
            this.pbProgress.Location = new System.Drawing.Point(3, 16);
            this.pbProgress.Name = "pbProgress";
            this.pbProgress.Size = new System.Drawing.Size(154, 23);
            this.pbProgress.TabIndex = 1;
            // 
            // ProgressControl
            // 
            this.AutoSize = true;
            this.Controls.Add(this.pbProgress);
            this.Controls.Add(this.lbCaption);
            this.Name = "ProgressControl";
            this.Size = new System.Drawing.Size(160, 42);
            this.ResumeLayout(false);
            this.PerformLayout();

        }
开发者ID:MechWipf,项目名称:gso_actor_design_example,代码行数:35,代码来源:ProgressControl.cs

示例15: InitializeComponent

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.PBar = new System.Windows.Forms.ProgressBar();
			this.SuspendLayout();
			// 
			// Description
			// 
			this.Description.Name = "Description";
			this.Description.Text = "The wizard has finished collecting information and is now ready to update your sy" +
				"stem. Press Next to continue.";
			// 
			// PBar
			// 
			this.PBar.Location = new System.Drawing.Point(40, 200);
			this.PBar.Maximum = 7;
			this.PBar.Name = "PBar";
			this.PBar.Size = new System.Drawing.Size(392, 23);
			this.PBar.Step = 1;
			this.PBar.TabIndex = 2;
			// 
			// S5_Install
			// 
			this.Controls.Add(this.PBar);
			this.Name = "S5_Install";
			this.NextStep = "Finish";
			this.PreviousStep = "S4_Modules";
			this.StepDescription = "The wizard has finished collecting information and is now ready to update your sy" +
				"stem. Press Next to continue.";
			this.StepTitle = "Install";
			this.ValidateStep += new System.ComponentModel.CancelEventHandler(this.S5_Install_ValidateStep);
			this.Controls.SetChildIndex(this.Description, 0);
			this.Controls.SetChildIndex(this.PBar, 0);
			this.ResumeLayout(false);

		}
开发者ID:aj9251,项目名称:pandorasbox3,代码行数:39,代码来源:S5_Install.cs


注:本文中的System.Windows.Forms.ProgressBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。