You are here: Setting ActiveX control properties with <param> tags « HTML « IT news, forums, messages
Setting ActiveX control properties with <param> tags

Posted by Chris Lieb on 09/25/14 11:30

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация