vb.net 中进度条值的问题 [英] problem with progressbar value in vb.net

查看:31
本文介绍了vb.net 中进度条值的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个网络浏览器.除了进度条,它工作正常.

i have designed a web browser.except for the progress bar it is working fine.

这是我的代码:

Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
     ProgressBar1.Maximum = e.MaximumProgress
     ProgressBar1.Value = e.CurrentProgress
End Sub

报告的错误是progressbar1.value 应该在max 和min 之间e.currentprogress = -1 是不可能的

the error reported is progressbar1.value should be between max and min e.currentprogress = -1 is not possible

推荐答案

值 -1 表示下载已完成",如该属性的 MSDN 库文章中所述.因此:

A value of -1 means "download has completed", as documented in the MSDN Library article for the property. Thus:

Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
  If e.CurrentProgress = -1 Then
     ProgressBar1.Maximum = 100
     ProgressBar1.Value = 100
  Else
     ProgressBar1.Maximum = e.MaximumProgress
     ProgressBar1.Value = e.CurrentProgress
  End If
End Sub

或者您可能想使用 -1 来隐藏进度条.

Or you might want to use -1 to hide the progress bar.

这篇关于vb.net 中进度条值的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆