Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding cmdbuttons programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01321009
Message ID:
01321046
Vues:
17
There's better method to access an object in a container by its name
...
    with GETPEM(thisform, lcButtonName)
...
>
>Something like (Starting from (0,0) and have 3 buttons at a row:
>
>lnTop = 0
>lnLeft = 0
>FOR i = 1 TO 80
>    lcButtonName = 'cmd'+ALLTRIM(STR(i))
>    thisform.AddObject(m.lcButtonName,'commandbutton')
>    with evaluate('thisform.' + m.c)
>         .Top     = m.lnTop
>         .Left    = m.lnLeft
>         IF i % 3 == 0
>            lnTop  = lnTop + .Height + 1
>            lnLeft = 0
>         ELSE
>            lnLeft = lnLeft + .Width + 2
>         ENDIF
>         .visible = .t.
>    endwith
>next
>
>Not tested :-)
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform