vb6.0中进度条的使用方法

来源:百度知道 编辑:UC知道 时间:2024/05/27 18:36:54
怎么添加进度条控件~~本人新手 欢迎大家来指导啊

添加进度条控件~~方法:
在工具箱处点右键--""添加部件
弹出的框拉下来
选中Microsoft Windows Common Control 6.0或5.0
应用后,在工具箱就可以看到进度条控件(ProgressBar)了.

Sub LoadUsers()
On Error Resume Next
Screen.MousePointer = 11
Dim xlspath As String
Dim xlsConn As New ADODB.Connection
Dim xlsrs As New ADODB.Recordset
Dim sql As String
Dim totalRecords As Long

xlspath = Text1
sql = "select * from [Sheet1$]"

With xlsConn
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & xlspath & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"
.CommandTimeout = 5
.Open
End With

xlsrs.Open sql, xlsConn, adOpenStatic, adLockReadOnly
totalRecords = xlsrs.RecordCount

ProgressBar1.Max = totalRecords
ProgressBar1.Min = 0
ProgressBar