Oljynx
August 16th, 1999, 12:33 AM
Hi,
I am actually looking for the click event of a Label control(in VBScript) as a Label object. When I create an label object through activex(.ocx) control and use that in my VBScript coding (which is shown below), for my surprise the click event is not working.But I have copied the same code from a book (where the author has given an example ) of his own class-id it seems to work perfectly. Now my question is, why is the click event for the class-id created by me is not working?
I have included both the sample codes below.
Code copied from a book (works perfectly)
<html>
<head>
<title> A sample label Control </title>
<SCRIPT LANGUAGE="VBSCRIPT">
sub sralabels_Click
msgbox "hello"
end sub
</script>
</head>
<body>
<OBJECT
classid="clsid:99B42120-6EC7-11CF-A6C7-00AA00A47DD2"
id=sralabels
width=240
height=240
align=left
hspace=5
vspace=5>
<param name="angle" value="0" >
<param name="alignment" value="1" >
<param name="BackStyle" value="0" >
<param name="caption" value="Label Object">
<param name="FontName" value="Arial">
<param name="FontSize" value="20">
<param name="FontBold" value="1">
<param name="FontItalic" value="1">
<param name="ForeColor" value="100">
</OBJECT> </body></html>
----------------------------
But when I include my own classid(an ocx which I have created the Click event
is not working whereas only the object appears.
This is the code that has the classid for an ocx control created by me.ie..
<HTML>
<head>
<script language="vbscript">>>
sub sralabels_Click
msgbox "This is a simple Label Control">> end sub
</script>
</head>
<BODY>
<OBJECT classid="clsid:A1DEEA79-50CB-11D3-8780-008048EF95C1"
id=sralabels
width=240
height=240
align=left
hspace=5
vspace=5
<param name="angle" value="0" >
<param name="alignment" value="1" >
<param name="BackStyle" value="0" >
<param name="caption" value="SRA Label Object">
<param name="FontName" value="Arial">
<param name="FontSize" value="20">
<param name="FontBold" value="1">
<param name="FontItalic" value="1">
<param name="ForeColor" value="100">
</OBJECT>
</BODY>
</HTML>
I couldn't guess why this event doesn't work.. Please share with me about this idea.And one more thing ..
If I want the classid created by my ocx control to be used elsewhere, then what should I do for it.
Thanks
Oljynx
I am actually looking for the click event of a Label control(in VBScript) as a Label object. When I create an label object through activex(.ocx) control and use that in my VBScript coding (which is shown below), for my surprise the click event is not working.But I have copied the same code from a book (where the author has given an example ) of his own class-id it seems to work perfectly. Now my question is, why is the click event for the class-id created by me is not working?
I have included both the sample codes below.
Code copied from a book (works perfectly)
<html>
<head>
<title> A sample label Control </title>
<SCRIPT LANGUAGE="VBSCRIPT">
sub sralabels_Click
msgbox "hello"
end sub
</script>
</head>
<body>
<OBJECT
classid="clsid:99B42120-6EC7-11CF-A6C7-00AA00A47DD2"
id=sralabels
width=240
height=240
align=left
hspace=5
vspace=5>
<param name="angle" value="0" >
<param name="alignment" value="1" >
<param name="BackStyle" value="0" >
<param name="caption" value="Label Object">
<param name="FontName" value="Arial">
<param name="FontSize" value="20">
<param name="FontBold" value="1">
<param name="FontItalic" value="1">
<param name="ForeColor" value="100">
</OBJECT> </body></html>
----------------------------
But when I include my own classid(an ocx which I have created the Click event
is not working whereas only the object appears.
This is the code that has the classid for an ocx control created by me.ie..
<HTML>
<head>
<script language="vbscript">>>
sub sralabels_Click
msgbox "This is a simple Label Control">> end sub
</script>
</head>
<BODY>
<OBJECT classid="clsid:A1DEEA79-50CB-11D3-8780-008048EF95C1"
id=sralabels
width=240
height=240
align=left
hspace=5
vspace=5
<param name="angle" value="0" >
<param name="alignment" value="1" >
<param name="BackStyle" value="0" >
<param name="caption" value="SRA Label Object">
<param name="FontName" value="Arial">
<param name="FontSize" value="20">
<param name="FontBold" value="1">
<param name="FontItalic" value="1">
<param name="ForeColor" value="100">
</OBJECT>
</BODY>
</HTML>
I couldn't guess why this event doesn't work.. Please share with me about this idea.And one more thing ..
If I want the classid created by my ocx control to be used elsewhere, then what should I do for it.
Thanks
Oljynx