本文整理汇总了C#中System.Windows.Forms.WebBrowserProgressChangedEventArgs.MaximumProgress属性的典型用法代码示例。如果您正苦于以下问题:C# WebBrowserProgressChangedEventArgs.MaximumProgress属性的具体用法?C# WebBrowserProgressChangedEventArgs.MaximumProgress怎么用?C# WebBrowserProgressChangedEventArgs.MaximumProgress使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.WebBrowserProgressChangedEventArgs
的用法示例。
在下文中一共展示了WebBrowserProgressChangedEventArgs.MaximumProgress属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WebBrowser1_ProgressChanged
private void WebBrowser1_ProgressChanged(Object sender, WebBrowserProgressChangedEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CurrentProgress", e.CurrentProgress );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "MaximumProgress", e.MaximumProgress );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ProgressChanged Event" );
}
开发者ID:.NET开发者,项目名称:System.Windows.Forms,代码行数:9,代码来源:WebBrowserProgressChangedEventArgs.MaximumProgress
示例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,代码来源:WebBrowserProgressChangedEventArgs.MaximumProgress