Re: Accessing Form Objects Numerically...

Author: MB Software Solutions, LLC

Posted: 2012-06-20 at 16:50:11

On 6/20/2012 5:35 PM, Kurt Wendt wrote:

> Hey folks,

>

>

>

> I'm working on something here at work - that's a bit of a PITA. This

> particular client has 2 versions of a system - one looks like FP for DOS

> (white letters on Blue screen for most of the system) and runs under

> VFP7. The other system is a true VFP system with graphical screens and

> runs under VFP9.

>

>

>

> I've been now asked to add new functionality - but, to BOTH systems -

> and I am attempting to make a screen that will actually run under both

> systems. Yes, even the system with the Blue screens has Some graphics

> screens. Although - the data look-up routines are Completely different

> for Each of them. The VFP7 one just draws on the current screen with @

> Say/Gets. Where as the lookups for the VFP9 one pops-up other forms and

> views the data within it.

>

>

>

> At one point - I actually got the data browsing to work - and the

> initial buttons & Text on the Form just disappeared and the Data

> browsing was coming up. But, after I added a couple more screen objects

> - it doesn't work right - and the data browsing is occurring BEHIND the

> existing objects (like Text, a button, a box, etc.).

>

>

>

> Now - I figured I could just put all those objects in a Container - and

> then make the Container invisible - and do the data browsing. But,

> that's a PITA - since, EVERY time I want to edit that Form - I first

> have to Edit the Container - then once I am in the Container I can

> Add/Edit objects.

>

>

>

> So - I am curious. Is there a Numerical way I can just go thru all the

> objects on a screen? Like, if the objects are listed in an array or

> something? I found something about an Object Hierarchy - I think it may

> have mentioned an array - within the online help - but, it didn't go

> into any details...

You can use a FOR EACH oObject in thisform.Controls loop to cycle

through. Sounds like you might just need to adjust the ZOrder property

of the controls that are showing behind.

Why you'd use @SAY/GET in VFP7, I don't understand, though.

Another idea is to save the group of controls to a container class as

you said and either toggle the visible property, or I suppose you could

RemoveObject/AddObject to toggle them in use as well. ??

--

Mike Babcock, MCP

MB Software Solutions, LLC

President, Chief Software Architect

http://mbsoftwaresolutions.com

http://fabmate.com

http://twitter.com/mbabcock16

_______________________________________________

Post Messages to: ProFox@leafe.com

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/4FE24593.3050504@mbsoftwaresolutions.com

** 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.

©2012 MB Software Solutions, LLC