>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