Hi everyone,
This has got to do with creating, altering and deleting controls at runtime.
I've got a label being created at runtime (i.e. controls.add("Forms.Label.1", "myLabel",True) and have it assigned to a class to handle its events. Another procedure that searches for this control using FOR EACH ctl IN me.controls, IF ctl.name = "myLabel" THEN do some formatting of ctl.
The problem is that it somehow clones the original label when doing the formatting. I only discovered this by changing the position of ctl and seeing two copies, the original plus the newly cloned and correctly formatted version.
The workaround is using zorder to bring the clone forward and backward as required. However, I'd rather work out how to stop the control from cloning in the first place.
PS: I'd be happy enough if I could delete the cloned label, but I'm not sure of the syntax.. I've tried DELETE ctl and ctl.delete already.
Any ideas? Thanks!
Vlad
This has got to do with creating, altering and deleting controls at runtime.
I've got a label being created at runtime (i.e. controls.add("Forms.Label.1", "myLabel",True) and have it assigned to a class to handle its events. Another procedure that searches for this control using FOR EACH ctl IN me.controls, IF ctl.name = "myLabel" THEN do some formatting of ctl.
The problem is that it somehow clones the original label when doing the formatting. I only discovered this by changing the position of ctl and seeing two copies, the original plus the newly cloned and correctly formatted version.
The workaround is using zorder to bring the clone forward and backward as required. However, I'd rather work out how to stop the control from cloning in the first place.
PS: I'd be happy enough if I could delete the cloned label, but I'm not sure of the syntax.. I've tried DELETE ctl and ctl.delete already.
Any ideas? Thanks!
Vlad