Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Arrays -- how to make 'em
Message
 
 
To
07/05/1998 10:34:29
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00096935
Message ID:
00097736
Views:
30
Jeff,

You can process the thisform.Controls[] array and create another array of three columns.
n = 1
for each oCoontrol in this.Controls
   if ( "cbo" $ oControl.Name )
      dimension this.maPairing[n,3]
      n = n + 1
      this.maPairing[n,1] = oControl
   endif
endfor


Now you'd need a little more code to pair the right items up, based on maybe the rest of the Name or the .Tag field.

Holding object references to contained objects will prevent your form from destructing, so you'll have to .NULL. out the array in the QueryUnload() and/or Release() before the form will be able to close.

>The big problem with putting controls in a container is that tab order of the controls is affected in an undesirable way (i.e., I couldn't see any way to have controls in the container and ones outside it interleave their tab order).
>
>Otherwise, it's an ideal solution.
>
>What I have is sets of controls that are "paired up," (dropdown/textbox/checkbox), and I want to be able to do things in the code of one that can affect its corresponding other controls -- both within its type (e.g., to enforce uniqueness of a value in a dropdown selection) and across types (i.e., to auto-fill the value of a textbox when its corresponding drop-down changes its value).
>
>With a set of arrays of each of the paired types, I can do this by getting a handle on the index of one control to affect the paired-up controls, and iterate across the index to affect other controls of that type.
>
>AND, I can interleave the tab order of the controls so that all paired-up controls are sequentially ordered.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform