I'm afraid my use of terminology may be incorrect and causing confusion. What I want to do is to emulate the feature in QuickBooks that is active in any dollar amount field where one can enter "12.34 + 56.78 Enter" and have the calculation result, "69.12", entered into the field. When a user enters an operator, the program opens a control that overlays the field and displays each line of the calculation on a line of its own - emulating a paper tape adding machine.
I have taken the approach of using a TextBox as the initial control. If the user keys "10 Enter", 10 is accepted as the value and focus moves to the next control in the tab order. If the user keys "10+", an EditBox overlaying the TextBox is created. The EditBox is initialized with "10" on the first line and "+" on the second line. When the user has completed entry with an "Enter", the calculated result is written to the Value property of the TextBox, the EditBox is removed, and focus moves to the next control. If I get this all working it would be nice to add a read only EditBox adjacent on the right to display a running balance in another color. I believe I can make this work with a single instance on a form if I add support properties and methods to the form but really want to simply drop controls anywhere without needing to worry about adding anything else. Perhaps there is a better approach to achieve what I want. Using an initial EditBox and simply resizing it would eliminate my learning how to access the properties of the two boxes but probably eliminates the option of having a second column in a different color as a running balance. Thanks for any counsel - Joe On Saturday, January 03, 2009 1:11 AM, MB Software Solutions General Account wrote: > >Date: Sat, 3 Jan 2009 01:11:24 -0500 (EST) >From: MB Software Solutions General Account >To: [email protected] >cc: >Subject: Re: Accessing the properties of a parent (newbee) > >Joe Yoder wrote: >> I trying to get the hang of working with classes. At this point I am >working exclusively in code. I understand it will be possible to >convert to VCX? format when I finally understand what I am doing. >> >> I'm not sure if "child", "parent" and "subclass" are proper terminology >so if what I say doesn't make sense feel free to question/correct me. I >want to subclass a TextBox so that it can create an EditBox on the fly. >I need the child EditBox to be able to read and write the parent TextBox >properties. I started expecting to return parameters like one does from >functions but suspect that won't work after a control has lost focus. >> >> I have a mockup partially working but am using a form method called from >the TextBox to create the EditBox rather than a method on the subclassed >TextBox. I don't know how to handle the naming in this situation. Do I >need to worry about name collisions or will the system handle it for me? >> >> A very simple example would probably be the easiest way for me to get >the light bulb to come on! >> >> Thanks in advance, > > >In VFP, it's single inheritance---so a textbox subclassed will always be >a textbox. A textbox can't become an editbox or label or form, etc. An >editbox subclassed is an editbox. I had written some easy PRGs showing >how inheritance worked about 10 years ago for Central PA Visual Foxpro >User Group...I'll see if I can find them (but I doubt it). The help >manual isn't bad, and of course Hentzenwerke.com's catalog of VFP books >is 2nd to none in that regard. > > > > > [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.

