Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LABEL color class
Message
From
01/11/2004 16:04:41
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00951785
Message ID:
00956703
Views:
20
>Scratch that last quest. prob solved.
>

Glad you solved the problem, but I need to say something. The class I gave you, only has a basic functionality. If you want to do more than that, such as changing the caption anytime you want (i.e.: when refreshing the form), you have to modify the class.

Update:
OK. Let's do this.
- Open up the ColorLabel class
- Add a method named "SetCaption"
- Open the Init event, cut all the code there and paste to the SetCaption method
- Add this code in the Init event:
This.SetCaption()
- From the Class menu, click on "Edit Property/Method.."
- From the property dialog, Select Caption property then check on the "Assign Method", click on apply.
- Now you have one more new method called "Caption_Assign". Put this code in that method:
Local ln_X

With This
   If !(.Caption == vNewVal)
      For ln_X = 1 to This.ControlCount
         lc_Object = 'lblName' + alltrim(str( ln_X ))
         .RemoveObject( lc_Object )
      Next

      .Caption = vNewVal
      .SetCaption()
   endif
EndWith
Now you can assign the caption anytime you want.

HTH
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform