Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BindEvent() and DoDefault
Message
 
 
To
08/07/2010 09:03:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01464849
Message ID:
01471843
Views:
58
>>>I have some code, which is repeated in all grid columns in most grids all over the application. In trying to centralize this, to have the code in a single place (and, especially, not having to call a special program every time I add a grid column!), I experimented with BindEvent(). The code contains This. and ThisForm., which I managed to translate.
>>>
>>>But where I am stuck is that I don't think it possible to translate a NODEFAULT in the original code. This occurs in Header.MouseDown and in Text1.DblClick. It doesn't seem feasible to "send" the NODEFAULT from the delegate back to the calling object. Any ideas?
>>
>>Interestingly I have the very similar problem now and I'm trying to figure out a good solution.
>>
>>I have a pageframe on the form. I want to be able to detect changes and prevent user from leaving the page if there are changes done.
>>
>>I can write a code in Page.Deactivate:
>>
>>If changes were made and user answer Cancel on the question 'Do you want to save changes?'
>>there should be NODEFAULT in the page.Deactivate.
>>
>>Now, since there is exact same code in all pages, it will be nice to bind them to form's custom method. However, how do I prevent users to leave the page using this technique?
>>
>
>Why not use a Page class instead of the default page?
>
>Tamar

This is a novel idea. I guess I haven't thought about it as I never used page class before. Do I need to create page class in code? Also, the form is already designed, how can I change page class?
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