當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。