AttrMaxAndMinForList
int AttrMaxAndMinForList (int panel, ListType listOfControls, int attribute, int *maximum, int *ctrlWithMax, int *minimum, int *ctrlWithMin);
Purpose
This function examines the value of the control attribute for each control in the list. It returns the minimum and maximum values of the attribute and the IDs of the controls it found those values on.
This function can be very useful for getting information needed to size and position controls when programatically creating dialog boxes.
Parameters
Input | ||
Name | Type | Description |
panel | int | The specifier for a particular panel that is currently in memory. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function. |
listOfControls | ListType | This parameter should be a list of control IDs (see the Lists... class of functions). |
attribute | int | Specify which attribute to examine in each control. The data type of the attribute must be integer (example: ATTR_TOP, ATTR_LABEL_WIDTH). |
Output | ||
Name | Type | Description |
maximum | int | Returns the maximum value of the attribute in the list of controls. You may pass zero if you do not need this value. |
ctrlWithMax | int | Returns the control ID of the control with the maximum value of the specified attribute. You may pass zero if you do not need this value. |
minimum | int | Returns the minimum value of the attribute in the list of controls. You may pass zero if you do not need this value. |
ctrlWithMin | int | Returns the control ID of the control with the minimum value of the specified attribute. You may pass zero if you do not need this value. |
Return Value
Name | Type | Description | ||
status | int | Returns 0 if the function succeeded or a negative error code if the function failed. The possible negative error codes are:
A description of any of these error codes can be obtained using the GetGeneralErrorString function in the toolbox.fp instrument driver. |
Additional Information
Library: Programmer's Toolbox
Include file: toolbox\toolbox.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later