Further question - I tried the code you suggested immediately before the addobject in the procedure that adds the text box. VFP tells me that I have broken the rules with a "Statement is not a procedure" compiler error message. Where do I put the class definition code? Does it need to be a part of a library for all time or can it be limited to a project until I really understand what I am doing? Thanks - Joe On Monday, December 22, 2008 7:37 AM, Joe Yoder wrote: > >Date: Mon, 22 Dec 2008 07:37:54 -0500 >From: Joe Yoder >To: [email protected] >cc: >Subject: Re: Newbee - working with a programmatically created text box > >Thanks for the answer. I have never fully understood the process off >defining my own classes. I thought in this case I could simply use an >existing class but could not figure out how to set the Valid function. >Do I understand correctly that the only way to control such functions is >to define my own class? Thanks - Joe > >On Sunday, December 21, 2008 11:33 PM, MB Software Solutions General >Account wrote: >> >>Date: Sun, 21 Dec 2008 23:33:02 -0500 (EST) >>From: MB Software Solutions General Account >>To: [email protected] >>cc: >>Subject: Re: Newbee - working with a programmatically created text box >> >>Joe Yoder wrote: >>> I like the approach used by QuickBooks where pressing a mathematical >>operator in a numeric field brings up a mini worksheet where one can do >>math on the value in the field. I'm working a similar implementation >>for time entry. >>> >>> A text box overlays a field used for time entry when a plus or minus >>operator is pressed in that field. The text box expands to display a >>separate line for each value added or subtracted from the original value >>and serves as a mini worksheet. When the entry is complete and the user >>presses the "Enter" key, The text box is eliminated and the result of >>the math on the worksheet is entered in the original text field. >>> >>> I need to force all entry into the worksheet until it is complete so >>that program can finish the calculation and close the worksheet. I >>think setting the valid as always false until an "Enter" is pressed will >>give the desired result. >>> >>> Can someone enlighten me about how to set the Valid function on a >>programmatically created text box? Suggest a better approach? >>> >> >> >>Hi Joe, >> >>If you're "stickbuilding it" by creating it in a PRG, just define the >>Valid event of your class. >> >>DEFINE CLASS cboSample as Combobox >> >> FUNCTION Valid >> * This code runs just like it would if you set the code inside a VCX >> object >> ENDFUNC >> >>ENDDEF >> >> >> >> >> [excessive quoting removed by server]
_______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

