Thank you, Alex.
I'm sorry to forget metion my system:
AutoCAD 2006
Visual Studio .Net 2003
.Net Framework 1.1
I change Function to Sub, but still not work
I also tried another solution: use the C# version to create a dll file, create a new VB.NET project with all test code inside.
The VB test code is same as the one in C#, which shouldl run the progressBar twice. but in my VB test code, the 2nd time is fine but the 1st one will go to like 90% very fast and stay there for a while, then start the 2nd one.
What the problem could be ?
Thank you and Tony for your help.
here is the code:
[code]
Imports Autodesk.AutoCAD.Runtime
Imports CaddZone.AutoCAD.EditorServices.StatusBarProgressMeter
Public Class TestProgressMeter
#Region "StatusBarProgressMeter"
_
Public Shared Function Execute()
' setup a bogus collection to be processed,
' where we want to show the progress...
Dim count As Integer = 10000 ' size of ArrayList (and the number of
' times we call Step() when processing it).
Dim myList As New ArrayList(count)
'Dim meter1 As New CaddZone.AutoCAD.EditorServices.StatusBarProgressMeter("Populating ArrayList...", count)
Try
For i As Integer = 0 To count
myList.Add(i)
' waste some cpu cycles so we
' can see the progress meter:
Dim x As Integer = 0
For j As Integer = 0 To 100000
x = j + i
' Update progress meter
'meter1.Step()
Next
Next
Catch ex As Exception
Finally
'meter1.Dispose()
End Try
Dim meter2 As New CaddZone.AutoCAD.EditorServices.StatusBarProgressMeter("Processing ArrayList...", myList.Count)
Try
For Each n As Integer In myList
' waste some cpu cycles so we
' can see the progress meter:
Dim x As Integer = n
For j As Integer = 0 To 100000
x = j + 1
Next
' Update progress meter:
meter2.Step()
Next
Catch ex As Exception
Finally
meter2.Dispose()
End Try
End Function
#End Region
End Class
[/code]
Windows 10 64 bit, AutoCAD (ACA, Map) 2023