Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collecting control names
Message
De
26/08/2013 13:46:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01581438
Message ID:
01581446
Vues:
45
>Greetings all.
>
>I have a question about gathering names in developer mode. I made a builder that creates arrays and SQL statements for validation or lookups. The SQL statement will be built with any number of where clauses based on user’s input. To simply the SQL statement, the builder creates MVs that contain the ‘where’ logic and this mv is then evaluated in the SQL statement with the & operator.
>
>After the base code is created, the developer then must fill in the control names for the ‘where’ logic. In most cases the code is used for finding records. So the controls will have the desired data qualifications you will search by.
>
>In design mode, can I gather the control names from a particular form in order to select them from a dropdown list to further complete this builder?
>
>Thank you in advance,
>
>Gary De Lecce

Tamar gave you an answer for VFP

With .NET, the code below disables all the controls on a form.
You could change to code to add the names to the items in your listbox.
I assume by controls you mean controls that address data, as opposed to buttons, labels, etc., so you'd have add some code to limit the list to the controls you want.

Note that Tab Pages have to be dealt with.
foreach (Control c in this.Controls)
      {
        c.Enabled = false;
        foreach (Control d in c.Controls)
          if (d is TabPage)
            foreach (Control ctl in d.Controls)
            {
              if (ctl is Label)
              {
                ctl.Enabled = true;
              }
              else
              {
                ctl.Enabled = false;
              }
            }
          else
          {
            d.Enabled = false;
          }
      }
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform