Admin Production ni-theme
Current Publication

SetCtrlArrayAttribute

LabWindows/CVI

SetCtrlArrayAttribute

int SetCtrlArrayAttribute (int controlArrayHandle, int controlAttribute, ...);

Purpose

Sets the value of an attribute for all the controls in a control array.

This function calls SetCtrlAttribute on each of the controls in the control array.

If setting the attribute results in an error for all the controls in the control array, the first error encountered is returned. If setting the attribute results in an error for at least one control but not all controls, then the function returns the ID of the first control that reported the error. In this case, the attribute is successfully set on all the controls that did not report an error.

Note   When you set control attributes that affect the font of a control, set the ATTR_TEXT_FONT attribute first.

Parameters

Input
Name Type Description
controlArrayHandle int Specifier for a particular control array that is currently in memory. You obtain this handle from GetCtrlArrayFromResourceID or NewCtrlArray.
controlAttribute int The control attribute value to set.

In the function panel, when you click the control or press <Enter>, <Spacebar>, or <Ctrl-down arrow>, a dialog box appears containing a hierarchical list of the available attributes. Attributes whose values cannot be obtained are dimmed. Help text is shown for each attribute. To select an attribute, double-click it or select it and then press <Enter>.

If the attribute shown in this ring control has named constants as valid values, you can open a list of them by moving to the Attribute Value control and pressing <Enter>. The Attribute Values dialog box displays the values and value help for the constants.
attributeValue ... The value to which to set the control attribute.

If the attribute shown in this control has named constants as valid values, you can open a list of them by pressing <Enter>. The Attribute Values dialog box displays the values and value help for the constants.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

If setting the attribute results in an error for all the controls in the control array, the first error encountered is returned. If setting the attribute results in an error for at least one control but not all controls, then the function returns the ID of the first control that reported the error. In this case, the attribute is successfully set on all the controls that did not report an error.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 2010 and later

Example

Refer to userint\ledctrlarray.cws for an example of using the SetCtrlArrayAttribute function.