-
dumb question...
i am creating a new ocx. It includes the control (CompMon.ctl), a form (frmProperties.frm) and a module (modMain.bas). In the module I have a procedure that needs to change the property of an object in the control file (CompMon.ctl), how do I access / reference the embedded object.
This is what I expected to work:
Code:
UserControl.tmrPing.Enabled = False
or
Code:
CompMon.tmrPing.Enabled = False
Neither option works. Simply, how can reference the objects and properties of the control from within an included module?
Thanks
-
You'll need an object reference in the module. On the initialize of the control have it set the object reference to itself.
Some like:
In the standard module:
In the Initialize event of the control:
Now you should be able to access the control's properties through the object reference. IE: ctlRef.Enabled = True, etc.
See if that works for ya. I don't have a VB6 IDE in front of me to test it for ya.
-