ControlExtensionsSetControlReadonly Method
Recursively sets the read-only state in the children of the specified root
control.
Affects
TextBoxBase and
IReadOnlyCapable instances.
Namespace: KGySoft.WinFormsAssembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
public static void SetControlReadonly(
this Control control,
bool readOnly
)
<ExtensionAttribute>
Public Shared Sub SetControlReadonly (
control As Control,
readOnly As Boolean
)
public:
[ExtensionAttribute]
static void SetControlReadonly(
Control^ control,
bool readOnly
)
[<ExtensionAttribute>]
static member SetControlReadonly :
control : Control *
readOnly : bool -> unit
- control Control
- The root control.
- readOnly Boolean
- The read-only state to set.
In Visual Basic and C#, you can call this method as an instance method on any object of type
Control. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).