FormComboBoxControl.userWidth Method [AX 2012]

Sets or returns the width of the form combo box control in pixels.

public int userWidth([int value])

Run On

Client

Parameters

value
Type: int
The number of pixels to use as the width of the control; optional.

Return Value

Type: int
The number of pixels that the user specified as the width of the control; 0 (zero) if the user did not specify a character width.

The userWidth method returns the width in pixels, based on six times the number of characters. For example, if the user has specified 30 characters as the width of the control, the return value is 6 * 30 = 180.

To specify the width of the control in characters, users can right-click the control to open the setup form where the character specification is made.

The following example shows how to return and set the user width of a form combo box control.

int nWidth; 
 
// The ctrl variable was previously defined  
// as the FormComboBoxControl variable. 
 
// Return the width. 
nWidth = ctrl.userWidth(); 
 
// Specify the width. 
ctrl.userWidth(90);  // 15 characters * 6 pixels == 90

Community Additions

ADD
Show: