AndrewMozley
Programmer
I have a class amtext (subclass of textbox) which is used for entering all sorts of data - a product code for validation – a customer reference &c.
Usually an instance of this class, mytext, will need to validate the value of the field. So mytext.valid() will do various checks, call the DEFAULT() code of amtext and make an appropriate return.
But in some cases we need to bypass this check - for example, if the user has decided to Close the form, by clicking on a Close button (which includes its own checks in its click() method to see if the form should really be closed).
I handle this by including code in the MouseEnter() and Mouseleave() methods of the Close button and setting a property, e.g. Thisform.Close_pressed of the form.
This works pretty well, but it means (at present) that I need to include code at the start of each instance of mytext.valid() to check the value of Close_pressed.
Is there a way that I can include code in the definition of my amtext class to handle this? At present I have to include the check in each instance of amtext - if I remember !
Thank you.