Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regarding Tip: Control Valid() Fires Even When Read-Only
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Regarding Tip: Control Valid() Fires Even When Read-Only
Miscellaneous
Thread ID:
00781549
Message ID:
00781549
Views:
67
In the May 2003 issue of the FoxPro Advisor there is a tip called "Control Valid() Fires Even When Read-Only." It made perfect sense so I added it to my base textbox class. My problem is how to handle the RETURN .T. in the base class so processing stops. In a subclassed textbox, I have DODEFAULT() to call the base class code but after the code runs, it still processes the code of the subclassed textbox.

Example:
txtBase.Valid()
   **********************************************************************************
   * Code from "Control Valid() Fires Even When Read-Only" - FoxPro Advisor, May 2003
   **********************************************************************************
   IF THIS.READONLY
      RETURN .T.
   ENDIF
   **********************************************************************************

   *  NOTE: If ReadOnly = .F., still returns .T.
txtSubClass.Valid()
   DODEFAULT()

   * If the control is ReadOnly, I don't want this to occur!
   IF EMPTY(THIS.VALUE) 
      RETURN .F.
   ENDIF
What's a common way to handle this?

Thanks,
Aaron
Next
Reply
Map
View

Click here to load this message in the networking platform