@ ... CLASS Command Example

The following example demonstrates how @ ... CLASS can be used with programming techniques used in earlier FoxPro versions (in this example, use of READ to activate controls). @ ... CLASS is used to create a text box whose properties can be changed with the Visual FoxPro object-oriented programming techniques.

ON KEY LABEL is used to display the Windows Color dialog box when you press CTRL+I. The TextBox is placed on the main Visual FoxPro window using @ ... CLASS, and READ activates the text box.

CLEAR
ON KEY LABEL CTRL+I _SCREEN.PageFrame1.Page1.goFirstName.BackColor;
    = GETCOLOR( )
@ 2,2 SAY 'Press Ctrl+I to change the background color'

@ 4,2 CLASS TextBox NAME goFirstName
READ
CLEAR