Share via


FormComboBoxControl.widthMode Method

Gets or sets the calculation mode of the width of the control.

Syntax

public int widthMode([int value])

Run On

Client

Parameters

  • value
    Type: int
    An integer value that indicates how a control width is calculated. The value can be -1 for Exact mode, 0 for Auto mode, or 1 for Column width mode.

Return Value

Type: int
An integer value that indicates the current calculation mode.

Remarks

Calculate the width according to the following table.

Mode

Width Calculation.

Exact

The exact width of the control in pixels is used.

Auto

The width of the control is calculated automatically, and the value parameter is ignored.

Column width

The layout of the form determines the width of the control.

The width of the control might change when the calculation mode is set to Auto or Column width.

Examples

The following example shows how to return and set the width calculation mode for a combo box control in a form.

int nWidthMode; 
; 
 
// The ctrl variable was previously assigned 
// as a form combo box control variable. 
 
// Retrieve the width mode. 
nWidthMode = ctrl.widthMode (); 
 
// Set the width mode. 
ctrl.widthMode(-1); 
 
// Set the width. 
ctrl.widthValue(180);

See Also

FormComboBoxControl Class

FormComboBoxControl.width Method

FormComboBoxControl.widthValue Method