Partager via


FormControl.isUserSetupEnabled(Int32) Method

Definition

Retrieves a value that indicates whether the control allows for the specified level of customization.

public:
 virtual bool isUserSetupEnabled(int _neededSetupRights);
public virtual bool isUserSetupEnabled (int _neededSetupRights);
abstract member isUserSetupEnabled : int -> bool
override this.isUserSetupEnabled : int -> bool
Public Overridable Function isUserSetupEnabled (_neededSetupRights As Integer) As Boolean

Parameters

_neededSetupRights
Int32

A value from the FormAllowUserSetup enumeration that specifies the level of customization that is being queried for the control.

Returns

true if the control, design, and parent containers allow for the level of customization that is specified by the neededSetupRights parameter; otherwise, false.

Remarks

The following table describes the values for the neededSetupRights parameter.

FormAllowUserSetup::No 0 No changes can be made to the control. If this value is set for the neededSetupRights parameter, the method always returns true.
FormAllowUserSetup::Restricted 1 The user can change the editable, visible, skip, label, and width properties of the control. The user cannot move the control.
FormAllowUserSetup::Yes 2 The user can change the editable, visible, skip, label, and width properties of the control. The user can also move the control.

For this method to return true, the AllowUserSetup property for the design and all parent containers must allow for the level of access that is specified by the neededSetupRights parameter.

The following example shows how to determine the user setup rights for a control.

FormAllowUserSetup formAllowUserSetup = FormAllowUserSetup::No; 
switch (true) 
{ 
    case this.isUserSetupEnabled(FormAllowUserSetup::Yes): 
        formAllowUserSetup = FormAllowUserSetup::Yes; 
        break; 
    case this.isUserSetupEnabled(FormAllowUserSetup::Restricted): 
        formAllowUserSetup = FormAllowUserSetup::Restricted; 
        break; 
    case this.isUserSetupEnabled(FormAllowUserSetup::No): 
       formAllowUserSetup = FormAllowUserSetup::No; 
        break; 
} 
info (strfmt("formAllowUserSetup: %1", formAllowUserSetup));

Applies to