OWLNext 7.0
Borland's Object Windows Library for the modern age
|
As you do when you get control properties, you set the value of a control property by using either its name or its index number.
Although using the index is more efficient (because there is no string lookup), using the property name is usually more intuitive. You can use either method, depending on your preference.
TVbxControl provides the function TVbxControl::SetProp to set the properties of a control. SetProp is overloaded to allow you to set properties with either the index or name of the property. Each of these versions is further overloaded to allow you to set a number of different types of properties.
Parameter | Explanation |
first parameter | In the versions where the first parameter is an int, you specify the property by passing the property index. In the versions where the first parameter is a char *, you specify the property by passing the property name. |
second parameter | The second parameter is the value the property should be set to. |
third parameter | The third parameter is the index of an array property that you supply if the control requires it. Consult the documentation for your VBX control to discover if you need to supply this parameter and, if so, what the required values are. The function ignores this parameter if it is -1. |
Although there are five different data types you can pass to TVbxControl::GetProp, SetProp provides for six different data types. The last two versions of each type of call use a char * and the ANSI string class to represent a string. These versions allow flexibility when passing a character string into a control.
GetProp uses casting to allow a char * to function effectively as a string object.