在网页中使用activex要传参数还要加上
1,Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
str = PropBag.ReadProperty("Mic", "default")
UserControl_Initialize
End Sub
2,Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Mic", ls_value, "default"
End Sub
1------------------
工程只有一个控件,里边什么都没有放,添加了一个属性Mic
源代码如下:
Dim ls_value As String
Public Property Get Mic() As Variant
End Property
Public Property Let Mic(ByVal vNewValue As Variant)
Select Case vNewValue
Case "1"
ls_value = "A"
Case "2"
ls_value = "B"
Case "3"
ls_value = "C"
End Select
MsgBox ls_value
End Property