Specifies that a property is read-only.
Object
Attribute
MemberAttribute
ReadOnlyAttribute
[Visual Basic] Public Class ReadOnlyAttribute Inherits MemberAttribute [C#] public class ReadOnlyAttribute : MemberAttribute [C++] public __gc class ReadOnlyAttribute : public MemberAttribute [JScript] public class ReadOnlyAttribute extends MemberAttribute
Members that are marked with ReadOnly(true) or that do not have a Set method cannot be changed. Members that do not have this attribute or that are marked with ReadOnly(false) are read-write, and they may be changed. The default is No.
Note When you mark a property with ReadOnly(true), the value of this attribute is set to the constant member ReadOnlyAttribute.Yes. For a property marked with ReadOnly(false), the value is ReadOnlyAttribute.No. Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as ReadOnlyAttribute.Yes or ReadOnlyAttribute.No.
For more information, see TBD and TBD.
Namespace: System.ComponentModel
Assembly: System.dll
System.ComponentModel Namespace | MemberAttribute | PropertyDescriptor