<script id="clientEventHandlersVBS" language="vbscript" type="text/vbscript">
Sub DCellWeb1_SelChanged(ByVal col1, ByVal row1, ByVal col2, ByVal row2)
form1.DCellWeb1.CalculateSheet(form1.DCellWeb1.GetCurSheet())
End Sub
Sub DCellWeb1_SheetChanged(ByVal oldsheet, ByVal newsheet)
setRowNum
form1.DCellWeb1.CalculateSheet(form1.DCellWeb1.GetCurSheet())
End Sub
Sub DCellWeb1_DropCellSelected(ByVal col, ByVal row)
Dim sDropList
Dim sDropValue
Dim iCurSheet
iCurSheet=form1.DCellWeb1.GetCurSheet()
sDropValue=form1.DCellWeb1.GetCellString(col,row,iCurSheet)
if iCurSheet=1 then
if col=4 and row=9 then
if sDropValue="事业单位" then
sDropList="机构"+vbCrLf+"院校"+vbCrLf+"医疗卫生机构"+vbCrLf+"事业单位"+vbCrLf
elseif sDropValue="企业" then
sDropList="国企"+vbCrLf+"股份制"+vbCrLf+"合资企业"+vbCrLf+"民营企业"+vbCrLf+"外资企业"+vbCrLf
elseif sDropValue="其他机构" then
sDropList="团体"+vbCrLf+"中介机构"+vbCrLf+"其他"+vbCrLf
end if
form1.DCellWeb1.SetCellString 7,9,iCurSheet,""
form1.DCellWeb1.SetDroplistCell 7,9,iCurSheet,sDropList,0
end if
end if
form1.DCellWeb1.CalculateSheet(iCurSheet)
End Sub
Function getNum
dim sNum
sNum = inputbox("请输入需要新增的表行总数(小于100的正整数):","增加表行")
getNum = sNum
end Function
</script>
Sub DCellWeb1_EditFinish(text, approve)
Dim value
value = text
if IsNumeric(value) then
if ((value*10000) <> 0 and (value<100000000)) then
Dim intLocalConst
intLocalConst=0.5000001
if len(text) <> 0 then
if text<0 then
intLocalConst=-0.5000000
end if
text=CStr(fix(text*100+intLocalConst)/100)
approve=1
end if
end if
end if
End Sub

本文深入解析了 VBS 脚本中针对 DCellWeb1 控件的事件处理,包括单元格选择改变、工作表改变及拖放单元格选中等操作的实现细节。
1298

被折叠的 条评论
为什么被折叠?



