Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim descriptor As PropertyDescriptor = TypeDescriptor.GetProperties([GetType]())(PropertyName)
- Dim attribute As ReadOnlyAttribute = DirectCast(descriptor.Attributes(GetType(ReadOnlyAttribute)), ReadOnlyAttribute)
- Dim fieldToChange As FieldInfo = attribute.[GetType]().GetField("isReadOnly",
- System.Reflection.BindingFlags.IgnoreCase Or
- System.Reflection.BindingFlags.NonPublic Or
- System.Reflection.BindingFlags.Instance)
- fieldToChange.SetValue(attribute, [ReadOnly])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement