Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with method
Message
 
 
À
01/03/2001 13:21:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00481050
Message ID:
00481064
Vues:
10
Sorry, I misread the last part of the question. I would still consolidate all the code in 1 method [e.g., SetStatus] of your label class. I would then have a property on the lable [e.g. cStatus] to indicate the status of the label. Then use a DO CASE to determine which color and caption to set. Eliminate the DOEVENTS command. If your class is a label with the method, then the first command should be WITH THIS

Is the status set at design time and changed during runtime? The INIT could call the SetStatus method. On the cSTATUS property, create an ASSIGN method. Edit the label class, then go to Edit Property/Method under Tools. Go down to the cSTATUS property. Check the ASSIGN method box.

In the ASSIGN method, call the SetStatus method.

>I want to be able to set a label to one of the following 4 status:
>1 - "Ok" (need to change backcolor to green)
>2 - "To verify" (need to change backcolor to yellow)
>3 - "Invalid" (need to change backcolor to red)
>4 - "Read only" (need to change backcolor to blue)
>
>Then, I created a class with 4 methods (one for each status).
>*** FYI all methods are Public ***
>By example, in the ReadOnly method I put the following code:
>WITH THIS.lblResult
> .BackColor=RGB(255,0,0)
> .ForeColor=RGB(255,255,255)
> .Caption="Read only"
>ENDWITH
>DOEVENTS
>
>When I try to execute the method from the object instantiated,
>like this: MyObject.ReadOnly ----nothing happens
>I tried to put a DoDefault() in the parent method ----nothing happens
>
>What is the problem?
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform