Hello John,
your last suggestion ( customised controls ) is exactly what I want to do, as all my forms will use these base controls/classes, I just need some help as to where to put the code, initially I put it in the Init of each class but as the Forms' mode property is set/reset by a parameter passed to the form, this was no good as the controls are instantiated before the forms inits' fired
I'm sure the old days were easier!?
Regards
Pete Kane
>Hi Peter ---
>
>So the enable/disable is based on the state of the Form (captured by the Mode property)? IF so, I would think you'd want to test THISFORM.Mode within the Refresh method of the Form's controls so that they can change their "states" as desired. Also consider using customized control classes to put that code in ther class's refresh and not in each individual controls refresh.
>
>A good discussion on this can be found in John Petersen and Rod Paddocks book "Visual FoxPro 5 Enterprise Development"
>
>
>>Being a relative newcomer to VFP when I wrote my first app, I still coded my enable/disable, RO/RW code for my form controls in the Init of my form, I am now a little more OOP aware and would like to move it to the relevant classes, e.g. in the init of the control
>>
>>if this.parent.mode = 'VIEW'
>> this.readonly = .t.
>>endif
>>
>>etc..., can anyone give me some direction on this.
>>Regards
>>Pete Kane
Regards,
Peter J. Kane
Pete