Hi guys
I’m developing an activex control and I want to add some methods to it. Any one knows how to do it? Or is it possible?
Thank u very much
Printable View
Hi guys
I’m developing an activex control and I want to add some methods to it. Any one knows how to do it? Or is it possible?
Thank u very much
course its possible :p :p :p
the methods are the public Sub procedures that you write for it.
i.e.
Public Sub DoStuff()
MsgBox "Doing Stuff!"
End Sub
Then if you put the following code in a program that uses your OCX:
InstanceOfYouOCX.DoStuff()
NOTE: Methods are public!!! If you declare them with Dim or Private then they will only be available to the OCX itself, and not the forms etc that you create the instances on.
Good fun making OCX's innit?:D
NOTE: "OCX" should really be replaced with "ActiveX Control", which is what you used :D.
"OCX" is what they used to be called.
thanks:)
and where should i declare these subs? in a module or some event?
WHat i usually do is i just set aside a spot for all the methods of
that usercontrol and just place it there. So in the usercontrol's
code just plop the methods.
Do you need help learning how to do any other stuff with activex
controls such as events, properties, etc?
thanks alot my friends i know how to do these, i mean events,properties and stuff. but still i don no what do u mean by a putting aside a spot. do u mean a module or stuff?Quote:
Originally posted by macai
WHat i usually do is i just set aside a spot for all the methods of
that usercontrol and just place it there. So in the usercontrol's
code just plop the methods.
Do you need help learning how to do any other stuff with activex
controls such as events, properties, etc?
Ill give a quick example.Catch my drift?VB Code:
'My UserControl 'Ill put properties here Public Property Get MyProp() MyProp = "MYPROP!" End Property 'I'll put methods here Public Sub MyMethod(Text As String) MsgBox Text End Sub
I got it. thanks aloooot
No problem, man. If you need more help, you can contact me
AIM: Warlord Luke
ICQ: 127514321
Yahoo! Messenger: macai_wasati_legato
E-Mail: [email protected]
try searching in the COM and ActiveX part of the forum, you'll get a lot of answers and useful info there.;)