Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic Label
Message
De
01/03/2024 10:12:37
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
01/03/2024 07:51:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
01687658
Message ID:
01687668
Vues:
47
Don't think so, ADD OBJECT belongs to the DEFINE CLASS syntax, not to code running.

>can be done in more ways...
>
>oLabel = createobject( "Label")
>with oLabel
>endwith
>loForm.Addobject("elbl"+Alltrim(Recno()), "label", oLabel )
>
>upd: not really certain if
>scan
>  cLabel = "elbl"+Alltrim(Recno())
>  ADD OBJECT ("loForm."+m.cLabel)  AS label WITH ;
>    Top = , ;
>    Left = , ;
>    Visible = .T., ;
>    Name = m.cLabel
>endscan
>would work
>
>
>
>>>>>I'm really sorry for my earlier wrong comments. It seems that you can't use With-Endwith the way you do. Try the following workaround instead:
>>>>>
>>>>>  oLabel = "elbl"+Alltrim(Str(i))
>>>>>  loForm.Newobject(oLabel, "Label")
>>>>>  With eval("loform."+olabel)
>>>>
>>>>Another option is my favorite trick (stolen from Fabio, he found it)
>>>>
>>>>with getpem(loForm, oLabel)
>>>
>>>There are always several ways to the same goal with FoxPro. :-)
>>
>>There were two versions of the proverb, can't decide which one I prefer:
>>
>>if it can't be done three ways in fox
>>- it's not worth doing at all
>>- it can't be done anyway
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform