CenterCtrl
- Updated2023-02-21
- 1 minute(s) read
CenterCtrl
int CenterCtrl (int panel, int ctrl, int top, int left, int height, int width);
Purpose
This function centers a control in a specified area. The control is centered with respect to its bounding rectangle which includes its label (if any) and any additional parts it might have.
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. |
ctrl | int | Pass the ID of the control to center in the specified rectangle. The ID is the defined constant (located in the UIR header file) which was assigned to the control in the User Interface Editor, or the ID returned by the NewCtrl or DuplicateCtrl function. |
top | int | Specifies the top of the rectangular area to center the control within. |
left | int | Specifies the left of the rectangular area to center the control within. |
height | int | Specifies the height of the rectangular area to center the control within. |
width | int | Specifies the width of the rectangular area to center the control within. |
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