Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate a Control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01045768
Message ID:
01045793
Vues:
18
>>>Dear All,
>>>
>>>I've got several label for Sun to Sat, I would like to highlight the day of Today, like so
>>>
>>>I want to use substitue like this:
>>>
>>>X = DOW(Date())
>>>Thisform.Datelabel(X).background = RGB(0,0,255)
>>>
>>>
>>>Anything wrongs?! cos I couldn't
>>
>>You can name the labels as follows: the label that is represent Monday name it Label1, Tuesday ->Label2 etc.
>>Then
>>
>>X = DOW(Date(),2)
>>myLabel = [Thisform.Label]+TRANSFORM(x)
>>&myLabel..BackColor = RGB(0,0,255)
>>
>
>Minor suggestion to that:
>X = DOW(Date(),2)
>store rgb(0,0,255) to  ([Thisform.Label]+TRANSFORM(x)+ '.BackColor')
>
>E.g. in this case you don't need to use macro.
>
>If you need to invoke a method, then I usually do:
>
>luRetVal = evaluate(([Thisform.Label]+TRANSFORM(x)+ '.MyMethod()')
>
>And if you need to do lots of things with that object, you can do
>
>loLabel = evaluate(([Thisform.Label]+TRANSFORM(x))
>
>with loLabel
>   .visible = .t.
>   .backcolor = ...
>   .refresh()
>endwith
>
>
>I dislike macros if they used in the context they should not be used. It makes code harder to maintain...

It is a personal preference. But in this case I like your code more than mine :o)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform