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


C# ToolStripProgressBar.Value属性代码示例

本文整理汇总了C#中System.Windows.Forms.ToolStripProgressBar.Value属性的典型用法代码示例。如果您正苦于以下问题:C# ToolStripProgressBar.Value属性的具体用法?C# ToolStripProgressBar.Value怎么用?C# ToolStripProgressBar.Value使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在System.Windows.Forms.ToolStripProgressBar的用法示例。


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

示例1: NumericUpDown

requestedCountControl = new NumericUpDown();
requestedCountControl.Maximum = 1000;
requestedCountControl.Minimum = 1;
requestedCountControl.Value = 100;
flp.Controls.Add(requestedCountControl);
开发者ID:.NET开发者,项目名称:System.Windows.Forms,代码行数:5,代码来源:ToolStripProgressBar.Value

示例2: Main

//引入命名空间
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

public class WebBrowserDemo
{
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new Form1());
    }
}

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void webBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
    {
        toolStripProgressBar1.Maximum = (int)e.MaximumProgress;
        toolStripProgressBar1.Value = (int) e.CurrentProgress;
    }

    private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        toolStripProgressBar1.Value = toolStripProgressBar1.Maximum;
     
    }
}
partial class Form1
{
    private void InitializeComponent()
    {
        this.statusStrip1 = new System.Windows.Forms.StatusStrip();
        this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
        this.webBrowser1 = new System.Windows.Forms.WebBrowser();
        this.statusStrip1.SuspendLayout();
        this.SuspendLayout();
        // 
        // statusStrip1
        // 
        this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.toolStripProgressBar1});
        this.statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Table;
        this.statusStrip1.Location = new System.Drawing.Point(0, 488);
        this.statusStrip1.Name = "statusStrip1";
        this.statusStrip1.Size = new System.Drawing.Size(695, 22);
        this.statusStrip1.TabIndex = 0;
        this.statusStrip1.Text = "statusStrip1";
        // 
        // toolStripProgressBar1
        // 
        this.toolStripProgressBar1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
        this.toolStripProgressBar1.Name = "toolStripProgressBar1";
        this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 15);
        this.toolStripProgressBar1.Text = "toolStripProgressBar1";
        // 
        // webBrowser1
        // 
        this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.webBrowser1.Location = new System.Drawing.Point(0, 0);
        this.webBrowser1.Name = "webBrowser1";
        this.webBrowser1.Size = new System.Drawing.Size(695, 488);
        this.webBrowser1.Url = new System.Uri("http://www.java2s.com", System.UriKind.Absolute);
        this.webBrowser1.ProgressChanged += new System.Windows.Forms.WebBrowserProgressChangedEventHandler(this.webBrowser1_ProgressChanged);
        this.webBrowser1.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted);
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(695, 510);
        this.Controls.Add(this.webBrowser1);
        this.Controls.Add(this.statusStrip1);
        this.Name = "Form1";
        this.Text = "Form1";
        this.statusStrip1.ResumeLayout(false);
        this.ResumeLayout(false);
        this.PerformLayout();

    }
    private System.Windows.Forms.StatusStrip statusStrip1;
    private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
    private System.Windows.Forms.WebBrowser webBrowser1;
}
开发者ID:C#程序员,项目名称:System.Windows.Forms,代码行数:94,代码来源:ToolStripProgressBar.Value


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