以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教静态变量  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=71421)

--  作者:hbhb
--  发布时间:2015/7/10 21:22:00
--  请教静态变量
大师:增加行事件中的如下变量为何不能用一般变量?改成静态变量后值如何恢复为初始值零?
Application.DoEvents
static n As Integer = 0
n = n + 1 
Dim pro As  WinForm.ProgressBar = Forms("frmXjllbList").Controls("pro9")
If Math.Floor( 75/Vars("drows")*n) > 25 Then
pro.Value = Math.Floor( 95/Vars("drows")*n)
End If

--  作者:yinyb36
--  发布时间:2015/7/10 22:47:00
--  
Application.DoEvents
static n As Integer
n = 0
n = n + 1 
Dim pro As  WinForm.ProgressBar = Forms("frmXjllbList").Controls("pro9")
If Math.Floor( 75/Vars("drows")*n) > 25 Then
pro.Value = Math.Floor( 95/Vars("drows")*n)
End If