Important: The information in this document is obsolete and should not be used for new development.
SetControlValue
To change the current setting of a control and redraw it accordingly, you can use theSetControlValue
procedure. TheSetControlValue
procedure is also available as theSetCtlValue
procedure.
PROCEDURE SetControlValue (theControl: ControlHandle; theValue: Integer);
theControl
- A handle to the control whose current setting you wish to change.
theValue
- The new setting for the control.
DESCRIPTION
TheSetControlValue
procedure changes thecontrlValue
field of the control record to the specified value and redraws the control to reflect the new setting. For checkboxes and radio buttons, the value 1 fills the control with the appropriate mark, and 0 removes the mark. For scroll bars,SetControlValue
redraws the scroll box where appropriate.If the specified value is less than the minimum setting for the control,
SetControlValue
sets the control to its minimum setting; if the value is greater
than the maximum setting,SetControlValue
sets the control to its maximum.When you create a control, you specify an initial setting either in the control resource or in the
value
parameter of theNewControl
function. To determine a control's current setting before changing it in response to a user's click in that control, use theGetControlValue
function.SEE ALSO
Listing 5-13 on page 5-35 illustrates the use ofSetControlValue
to change the setting of a checkbox. Listing 5-16 on page 5-38 and Listing 5-20 on page 5-56 illustrate the use ofSetControlValue
to change the setting of a scroll bar.