VBScript的扫描进度条程序-VBScript
·当前位置: 学海荡舟-论文 >> 电脑技术 >> 网络编程 >> VBScript
VBScript的扫描进度条程序


<title>进度条</title>
<style>
BODY {background: #CCCCFF} BODY { overflow:hidden }
P.txtStyle {color: Navy; font-family: Verdana; font-size: 10pt; font-weight: bold; margin-left: 10px }
input.pbStyle {color: Navy; font-family: Wingdings; font-size: 10pt; background: Silver; height: 20px; width: 340px }
</style>
<div id="objProgress" class="Outer"></div>
<CENTER>
<b>
<SPAN id=txtMilestone class='txtStyle' style='margin-left: 10px'></SPAN>
<font color=green>
<SPAN id=txtRemarks class='txtStyle' style='margin-left: 10px'></SPAN>
</font>
<b>
<br>
<br>
<input type='text' id='pbText' class='pbStyle' value='' >
<br>
<br>
<input type='button' value='Cancel' onclick='SetReturnFlag("quit")' >
</CENTER>
<form name='secret' > <input type='hidden' name='pubFlag' value='run' ></form>
<SCRIPT LANGUAGE='VBScript' >
Sub SetReturnFlag(sFlag)
secret.pubFlag.Value = sFlag
txtMileStone.style.color = "Red"
txtRemarks.style.color = "Red"
End Sub
Function PctComplete(nPct)
pbText.Value = String(nPct," ") & String(4,"n")
End Function
Sub UpdateProgress()
Dim intStep
Dim intDirection

If (IsNull(objProgress.getAttribute("Step")) = True) Then
intStep = 0
Else
intStep = objProgress.Step
End If

if (IsNull(objProgress.GetAttribute("Direction"))=True) Then
intDirection = 0
Else
intDirection = objProgress.Direction
End If

if intDirection=0 then
intStep = intStep + 1
else
intStep = intStep - 1
end if

Call PctComplete(intStep)

if intStep>=23 then
intDirection=1
end if
if intStep<=0 then
intDirection=0
end if
objProgress.SetAttribute "Step", intStep
objProgress.SetAttribute "Direction", intDirection
Window.setTimeout GetRef("UpdateProgress"), 80
End Sub
Sub DialogHardTimeout()
SetReturnFlag("quit")
End sub
Sub Window_OnLoad()
theleft = (screen.availWidth - document.body.clientWidth) / 2
thetop = (screen.availHeight - document.body.clientHeight) / 2
window.moveTo theleft,thetop
Window.setTimeout GetRef("UpdateProgress"), 80
Window.setTimeout GetRef("DialogHardTimeout"), 3600000
End Sub
</SCRIPT>

  • 上一篇教程:
  • 下一篇教程:
  • :查看相关:
  • 使用ZendEncode编译PHP程序
  • PHP程序员的自我修炼:PHP编程风格
  • 如何利Mcrypt扩展库进行加密和解密
  • 采用 PEAR 来缓冲 PHP 程序
  • PHP应用程序的性能优化