Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locate a Control
Message
From
01/09/2005 09:18:56
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01045768
Message ID:
01045793
Views:
20
>>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform