Setting ActiveX control properties with <param> tags

C

Chris Lieb

I am writing an ActiveX control that gets information from the serial
port and displays the results in a label. I have declared the property
"value" that will hold this data. This control is going to act as a
field of a form and needs to be able to have its value set using HTML
for when it is used to edit records. If I use JavaScript, I can get
and set the value property. However, using the <param> tag seems to
have no effect on the control.


Here is the <object> tag:


<object
ID="barcodeTest"
classid="CLSID:C9575896-B228-4B1C-A854-6B0DA7F9BFD9"
width=241
height=25
base="activex/barcodegetter.ocx">
<param name="value" value="hello" />
</object>


Here is the related VB code in the ActiveX control:


Dim barCode as String

Public Property Get value() As String
value = barCode
End Property

Public Property Let value(ByVal oldCode As String)
barCode = oldCode
lblBarcode.Caption = barCode
PropertyChanged "value"
End Property

Public Property Set value(ByRef oldCode As Variant)
barCode = oldCode
lblBarcode.Caption = barCode
PropertyChanged "value"
End Property

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
barCode = PropBag.ReadProperty("value")
PropertyChanged "value"
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "value", barCode
End Sub


Anyone have any ideas? This is the first time that I have written an
ActiveX control and I can't seem to find this question answered
anywhere.

One more thing: Is there a way that I can make the value property of
the ActiveX control be submitted with the form without having to use
JavaScript to copy the value into a hidden field?


Thanks,
Chris
 
C

Chris Lieb

Well, I tried microsoft.public.vb.general, but no one there seems to be
very helpful.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top