Defining PROPERTY for

Posted by Roger Blanchard on 19-Feb-2013 07:56

I would like to define a PROPERTY that returns a value for the following that can be referenced by all classes.

EMD.VBoard2006.EMDStandard+KeyStyleEnum:ClassicGradient

Is this possible.

For a Color I would define a PROPERTY like the following.

DEFINE PUBLIC PROPERTY V_Kybd_BezelColor AS System.Drawing.Color NO-UNDO

GET ():

RETURN System.Drawing.SystemColors:GradientActiveCaption.

END GET.

All Replies

Posted by nicolas.andricq on 19-Feb-2013 08:13

Hello,

You can use STATIC in the the define if you want to call this property in each program.

Example:

DEFINE STATIC PROPERTY myProp AS System.Drawing.Color NO-UNDO.

GET:

     IF VAILD-OBJECT(myProp) THEN maProp = System.Drawing.SystemColors:GradientActiveCaption.

     RETURN maProp.

END GET.

PRIVATE SET.

Posted by Admin on 19-Feb-2013 08:13

EMD.VBoard2006.EMDStandard+KeyStyleEnum is a type (the type KeyStyleEnum is nested in the type EMDStandard).

So just define a property as EMD.VBoard2006.EMDStandard+KeyStyleEnum (you may have to quote it).

In the constructor of the class assign the value EMD.VBoard2006.EMDStandard+KeyStyleEnum:ClassicGradient to the property.

Posted by Roger Blanchard on 19-Feb-2013 08:32

The quotes were the solution. Thanks.

This thread is closed