Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Superclass ~ Subclass question
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00097195
Message ID:
00097206
Views:
17
>Hello
>
>I'm using VFP30b and I copied The buttons class from the
>VFP30\samples. I then added this library to a project
>
>I created another class in this library based on the
>'VCR' class called 'SCVCR'. Now I modified this class to
>have a Text object in the center of the 4 buttons, making
>room for the new text object. I wanted to update this
>text object when the database record pointer moved. with
>9/125 on record 9 of 125 records. I'm trying to do this
>in the Click() of the 'Prev' button. I don't see any code
>in this method. I put code in this method to update the
>text object
>
>'Prev' button.click() method
>r = ALLTRIM(STR(recno()))
>t = ALLTRIM(STR(reccount()))
>this.parent.textobjName.value = r +" / ""+ t
>this.parent.textobjName.refresh()
>
>* End of code
>
>during a trace this code is getting executed, but the
>default button's code is not.
>
>How can I get the default behavior to execute before my
>code executes.
>
>Thanks in advance
>
>Perry

Perry, if you subclassed something the inherited code fires automatically only if you have nothing in your subclass method (it should show [Default] for this method in Properties sheet.) If you have custom code in your method you have to explicitely call parent class method with scope resolution operator like
cmdPrevButton::Click() where cmdPrevButton is a name of your parent class for this control. VFP 5 in addiion has special DoDefault() method for this.

HTH,

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform