Assigning Object Properties


 

Properties are named attributes of a form or control. They define an object's characteristics, such as size, color, and screen location, and aspects of the object's behavior, such as whether it is enabled or not. You may set properties in the Properties window at design time and in code at execution time.

 

Setting Property Values using the Property Window:

1.   Select the form or controls desired.

2.   If the Properties Window is not visible, choose Properties from the Window menu or simply press the F4 key.

3.   From the Properties window, select the property you want by clicking the property name in the Property column. The Form Designer displays the current setting for the property in the Value column.

4.   In the value column, enter the property value desired:

  1. Repeat steps 3 and 4 for each property you want to set for the selected form or control.

 

Property Display Format

The Designer supports two styles of property display. The first two buttons in the Property Window Toolbar control the display format.

 

propertiesa1.jpg      propertiesa2.jpg

 

Property Window Display Modes

 

Multiple Selected Controls

When multiple controls are selected, the Property Window will show "(multiple selection") as the control name at the top of the window. The user has the option of seeing all properties that the selected objects have in common or all properties for all selected objects. The Plus (+) and Minus (-) buttons in the Property Window Toolbar control this display mode.

 

propertiesa3.jpg

 

Multiple objects selected

 

Setting Property Values in Code

To set form or control properties at run time, use the SETPROP or SETITEM instruction.

 

Example:

 

     SETITEM txtCustomer,0,"Sunbelt Customer"

or

     SETPROP txtCustomer,VISIBLE=0

 

The Designer supports an internal built in macro named &OBJNAME. This macro is transparent to the compiler and only applies to code in the Designer. The macro allows use of generic routines or statements in any number of object procedures without code modification.

Example:

 

     SETPROP &OBJNAME,ENABLE=0

 

This line will work equally well with an EDITTEXT object named 'txtCustomer' or a radio button named 'rdoOption'. When the form is saved, the Designer expands this macro to the name of the object to which this code is attached.

 



about_designer The Design Procedure Attaching Event Code