SavePanelState
- Updated2023-02-21
- 2 minute(s) read
int SavePanelState (int panelHandle, char filename[], int stateIndex);
Purpose
Saves the current values of all controls on a panel.
This function also saves the following control attributes:
- Label/value pairs of the list-type controls, and their indices
- Minimum, maximum, and increment values for numerics
- List box checkmark state values
![]() |
Note If you use the intptr_t or uintptr_t data type for a control, you must save and load the data from the controls in the same bitness. For example, you cannot save the data in a 64-bit application and then load the data in a 32-bit application. |
If you want to retain the data for plots in a graph control, your original array must still be in memory when you call RecallPanelState. Alternatively, you can configure the graph to make a copy of your plot data. You can do this in the User Interface Editor or by calling SetCtrlAttribute with the ATTR_COPY_ORIGINAL_DATA attribute.
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel. |
filename | char [] | Name of the file in which to save the panel state. If the name is a simple filename that contains no directory path, the file is saved in the directory that contains the executable. |
stateIndex | int | Assigns a unique state index to each panel state so that you can save
multiple panel states to the same file. When you recall a particular panel state using RecallPanelState, use the same State Index assigned using SavePanelState. If the file already contains a panel with the same state index, SavePanelState overwrites it. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later