The name of the form property that is used to refer to a component.

Property of

All form components

Description

A component’s name property reflects the name of the property of the form that is used to refer to the component.

For example, if pushing one button makes another button visible, the code looks like this:

function oneButton_onClick( )

form.anotherButton.visible = true 

In oneButton’s event handler, form refers to the form that contains the button, and anotherButton is a property of the form that contains an object reference to the PushButton object anotherButton.

When the form was created in the Form designer, the name property of the PushButton object was set to anotherButton. When the form is saved into a .WFM file, the resulting code for the button looks like this:

this.anotherButton = new PushButton(this)

with (this.anotherButton)

left = 10 

top = 0 

width = 8 

endwith

The name of the button is never assigned to the name property. Instead, the name of the button is determined by the name of the form property that contains the reference to the object. This is true for any form component that has a name property.

To change the name of a component in the .WFM file, change the name of the property in the initial assignment statement and the WITH statement below it.

When you read a component’s name property, dBASE Plus returns the name of the property that the component’s parent (the form unless the component is in a Container or NoteBook object) uses to refer to the object. The name is always all-uppercase.

If you assign a value to a component’s name property, you actually change the name of the form property that contains the component’s object reference. While this is allowed, there aren’t many reasons you would want to do that—avoid it.