setCtlVal

Syntax

int setCtlVal(int n, int v)

Arguments

n
The index of the user control whose value you want to change
v
The value you want to assign to the user control

Return

Returns the previous value of control n, or -1 if n is not a valid control index.

Description

This function changes the current value of the user control with the index n. Note that the value set has to be one within the user control's range. Also note that not all user controls support value settings (for example, you can only save values in a FRAME user control when it is disabled).

Example

setCtlVal(4, 30);
int iPrev = setCtlVal(5, 0);

Also see

ctl, getCtlVal

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.

setCtlVal() sets COMBOBOX control to 0 after 'OK'

//avoid calling setCtlVal when no dialog is displayed
if (doingProxy) setCtlVal(n, v);