0
我在嘗試更新我的用戶表單Updating
(這本質上是一個進度條)。它當前不會更新第一次調用用戶窗體,第二次只更新標籤說明而不更新欄的寬度。我正在使用下面顯示的TestUpdate
過程測試它。用戶表單沒有正確更新
我在做什麼錯?
Sub UpdateUpdatingUF(filenum As Integer, filecount As Integer)
Dim filenumdbl As Double
Dim filecountdbl As Double
Dim boxwidth As Integer
Dim barwidth As Integer
Dim boxwidthdbl As Double
filenumdbl = CDbl(filenum)
filecountdbl = CDbl(filecount)
boxwidthdbl = CDbl(boxwidth)
boxwidth = 300
barwidth = CInt(boxwidthdbl * filenumdbl/filecountdbl)
With Updating
.Label3.Caption = "Running file: " & CStr(filenum) & "/" & CStr(filecount)
.ProgressBar.Width = barwidth
End With
End Sub
Sub TestUpdate()
Updating.Show
Call UpdateUpdatingUF(3, 7)
DoEvents
Updating.Repaint
End Sub
我知道我可能會聲明太多的變量,但我試圖確保這不是原因。
你的意思是'Updating.Show VbModeless'或'Updating.Show(假)'?您可能需要添加一個解釋,說明爲什麼需要這樣做:) –
我得到錯誤446 - 「對象不支持命名參數」 – duhamp
'updating.show vbmodeless'工作使文本更改,但酒吧不會改變 – duhamp