Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Readonly vs. enabled

Status
Not open for further replies.

aharrisreid

Programmer
Joined
Nov 17, 2000
Messages
312
Location
GB
In my VFP application framework I currently use this.readonly=.T. for textboxes, editboxes and grids that I don't want edited. I have favored this over this.enabled=.F. because I still want the users to enter the control and scroll to see data that may not be in the visible area of the control. However, this means additional code must be added to ensure Valid() and LostFocus() code does not run. On the other hand, setting the enabled property is consistent with all those other controls that do not have a readonly property.

What do other users use to disable their foundation classes? Apart from what I have mentioned above, are there any other pros and cons of each approach?

Many thanks,
Alan Harris-Reid
 
I use the same methodology, but by subclassing those controls and placing the relevant code in the subclass to ignore the valids and so on, you only have to do it once.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Hi Alan,

Another factor ReadOnly allows cut and paste. Disabled does not.

Regards,

Mike
 
Mike, thanks for the reply.

>Another factor ReadOnly allows cut and paste. Disabled
> does not.

Good point. I had forgotton about that.

Regards,
Alan
 
Hi Alan,

Reread - Must have been a blonde moment;)

Copy, not cut.

Regards,

Mike
 
Mike,

>Copy, not cut.

Well spotted - I didn't!

Isn't it strange how one reads what one expects to read, not what is actually on the page?

Regards,
Alan

 
Isn't it strange how one reads what one expects to read, not what is actually on the page?

Yup, easy to repeat a mistake. That's why, if you can, you need to get someone to check your work.

Regards,

Mike
 
Mike..

Would that be called Extreme Posting?

*G*



Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Hi Craig,

I have Onanon *bg*

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top