>This solution does not allow to see correct captions in class designer (during DESIGN time!) to test different layouts, only at run time.
>
>Also, it requires writing sophisticated program to scan objects and adding custom properties to those object to describe to this program what exactly to do. This is very time-consuming solution.
Andrus,
Ok so here's the code required to do what I said using a Label. Create a label class named lblAutoCap, in its Init put;
IF NOT USED("Labelcap")
SELECT 0
USE LabelCap
ELSE
SELECT LabelCap
ENDIF
LOCATE FOR <Whatever condition you require>
THIS.Caption = LabelCap.Caption
Not very complex code. If you want to see the caption in the designer then set the caption property of the label in the property sheet.
Not only is this code not complex but it can handle situations you haven't even thought of yet.