classid=clsid:AEADDEFF-4CF4-4594-8A14-54E77FFD721D>
<param name="userName" value="jiangby">
</OBJECT></BODY></HTML>中的param中的userName在activeX的什么地方定义??
谢谢!!
<param name="userName" value="jiangby">
</OBJECT></BODY></HTML>中的param中的userName在activeX的什么地方定义??
谢谢!!
假设你的控件名称是Test
<Script Language=VBScript>
If Isobject(Test) Then
Test.UserName="UserName"
Else
MsgBox "未加载该控件!"
End If
</Script>
当然需要在控件内自定义UserName这个属性,对于在<param name="UserName" value="UserName">传递参数一直得不到解决,望高手指导:)
Begin VB.UserControl UserControl1
ClientHeight = 3600
ClientLeft = 0
ClientTop = 0
ClientWidth = 4800
ScaleHeight = 3600
ScaleWidth = 4800
Begin VB.TextBox txtPassword
Height = 630
Left = 975
TabIndex = 1
Top = 1665
Width = 2715
End
Begin VB.TextBox txtUserName
Height = 645
Left = 975
TabIndex = 0
Top = 540
Width = 2760
End
End
Attribute VB_Name = "UserControl1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Public Property Get UserName() As String
UserName = txtUserName.Text
End PropertyPublic Property Let UserName(ByVal str As String)
txtUserName.Text = str
End PropertyPublic Property Get Password() As String
Password = txtPassword.Text
End PropertyPublic Property Let Password(ByVal str As String)
txtPassword.Text = str
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
txtUserName.Text = PropBag.ReadProperty("UserName")
txtPassword.Text = PropBag.ReadProperty("Password")
End SubPrivate Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "UserName", txtUserName.Text
PropBag.WriteProperty "Password", txtPassword.Text
End Sub
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY><P>
<OBJECT classid=clsid:C5FA2CF1-638E-47E6-AC3C-BEADFDF36A3E id=UserControl11>
<PARAM NAME="_ExtentX" VALUE="8467">
<PARAM NAME="_ExtentY" VALUE="6350">
<PARAM NAME="UserName" VALUE="testuser">
<PARAM NAME="Password" VALUE="testpass"></OBJECT>
</P></BODY>
</HTML>