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 theSetControlValueprocedure. TheSetControlValueprocedure is also available as theSetCtlValueprocedure.
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
TheSetControlValueprocedure changes thecontrlValuefield 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,SetControlValueredraws the scroll box where appropriate.If the specified value is less than the minimum setting for the control,
SetControlValuesets the control to its minimum setting; if the value is greater
than the maximum setting,SetControlValuesets the control to its maximum.When you create a control, you specify an initial setting either in the control resource or in the
valueparameter of theNewControlfunction. To determine a control's current setting before changing it in response to a user's click in that control, use theGetControlValuefunction.SEE ALSO
Listing 5-13 on page 5-35 illustrates the use ofSetControlValueto change the setting of a checkbox. Listing 5-16 on page 5-38 and Listing 5-20 on page 5-56 illustrate the use ofSetControlValueto change the setting of a scroll bar.