Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Arrow Keys Don't Fire When, GotFocus, Click in Grid txtB
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00618623
Message ID:
00620233
Views:
27
>>>To create a New Method in a form, I know you go to Form - New Method. But how do you create a custom method in the grid?
>>>
>>>I do want the code to appear in only 1 place. It makes a project so much easier to maintain :-) TIA, Chuck
>>
>>Chuck,
>>
>>You need to have a special grid class in order to add new methods. You can not add new methods to base VFP controls.
>
>Nadya,
>
>Thanks. I am very familiar with creating custom methods on the form, so as to keep one instance of code in a central location, and it's been a life-saver. A UT member shared that bit of advice with me years ago. I can't remember his surname, but I think his first name is Jim, and he's a FoxPro author. Anyway, I haven't done any subclassing yet; so, I guess I still need to learn that one. I've always just re-used my objects by copying them from one form to another, etc.
>
>Thanks Again, Chuck

Hi Chuck,

Are you saying, that you haven't yet used classes in your applications and used base VFP classes everythere? This is very wrong, you have to create a library of all base VFP classes and customize these classes for your needs, if needed.

For instance, we have wgControls library, there we have all base VFP classes subclassed. Several of them don't have anything set, so they use VFP default properties. Few have some custom code, like grid class, for example.

Each application is based on these classes. If we need some specific code for the particular application, we subclass class from wgControls into new classlibrary, which would be in Classes of this application.

BTW, I guess, the person, who gave this advice to you, was Jim Booth, though I could be wrong. He is MVP and author of VFP books.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform