Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How establish ?
Message
From
04/01/2002 04:45:17
 
 
To
04/01/2002 04:29:51
Eugenijus Rimkus
SPAB Siauliu energija
Siauliai, Lithuania
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00600645
Message ID:
00600650
Views:
16
Hi!

There are several approaches for this.

1. This approach is usually used in the frameworks. Create base class for each control that you will use on the form for data editing. Create the form base class and base all your data forms on that form class. In the form class create a method "IsModified". In the base classes for each data control in the InteractiveChange even call thisform.IsModofied(). On each form defoine a code in the IsModified method on the form that will do everything reqiured as soon as used edited something (for example, in your case this is changing Enabled property of the Save button). Alternatively, in VFP6 or later, you can do this even better way: In the form class create a property "IsModified". In the base classes for each data control in the InteractiveChange even set thisform.IsModofied property to .T.. Define the _Assign method for IsModified property. In each data form you will be able to catch the moment when IsModified property changed and refresh controls on the form properly.

2. Call thisform.Refresh in the Valid event of each control. In the Refresh method of other controls (Save button) set the state of control properly. You can determine if data edited by using GetFldState(-1) function, if data not edited, it returns the string with all "1" in it. This approach is not very reliable, and sometimes slow.

3. Put a timer on the form that will check if data modified each 100 milliseconds, and if modified - change controls on the form.

HTH.

>Hi,
>
>I want to make enable command button (SAVE) in the form, then was done some modify in the fields (textbox, combo box) in that form. How establish that was maked some changes.
>
>Thanks
>Eugenijus
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform