<object classid=CLSID:DBCE01C1-37B2-11D2-B4A3-00C04F7BBDB2 id=HFilter width=300 height=20></object><br><br> <span id=spanMin></span> <br> <span id=spanMax></span>这样可以初始化 <script language=vbs> Sub Window_onLoad() HFilter.FilterMin = 1 HFilter.FilterMax = 100 HFilter.ThumbMin = 1 HFilter.ThumbMax = 100 End Sub控件中 Private nMin As Long Private nMax As Long Private nThumbMin As Long Private nThumbMax As LongPublic Property Get FilterMin() As Long FilterMin = nMin End PropertyPublic Property Let FilterMin(lMin As Long) nMin = lMin End PropertyPublic Property Get FilterMax() As Long FilterMax = nMax End PropertyPublic Property Let FilterMax(lMax As Long) nMax = lMax End Property
具体要求是:有vb的源码,html源码,不用太复杂,简单的就行,参数动态传递给ocx
//参数动态传递给ocx问的就是你参数的传递方式:)
可以通过object标签中加参数,但是不可行 必须通过 vbscript:call function 参数,这种方式才可行
原理其实就是online的ocx中加入property let set
<span id=spanMin></span>
<br>
<span id=spanMax></span>这样可以初始化
<script language=vbs>
Sub Window_onLoad()
HFilter.FilterMin = 1
HFilter.FilterMax = 100
HFilter.ThumbMin = 1
HFilter.ThumbMax = 100
End Sub控件中
Private nMin As Long
Private nMax As Long
Private nThumbMin As Long
Private nThumbMax As LongPublic Property Get FilterMin() As Long
FilterMin = nMin
End PropertyPublic Property Let FilterMin(lMin As Long)
nMin = lMin
End PropertyPublic Property Get FilterMax() As Long
FilterMax = nMax
End PropertyPublic Property Let FilterMax(lMax As Long)
nMax = lMax
End Property
必须通过
vbscript:call function 参数,这种方式才可行