You seem like you can. At the moment, I'm trying to do something like this, and I managed to work with CategoryAttribute. Currently, however, this stops the propertiesgrid property from working together, although although this is called in the button constructor:
Dim PC As PropertyDescriptorCollection = TypeDescriptor.GetProperties(Me)
For i As Integer = 0 To PC.Count - 1
Dim att As BrowsableAttribute = DirectCast(PC(i).Attributes(GetType(BrowsableAttribute)), BrowsableAttribute)
If Not att Is Nothing Then
If att.Browsable = True Then
Dim cat As Reflection.FieldInfo = att.GetType.GetField("Browsable", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.Public Or Reflection.BindingFlags.Static Or Reflection.BindingFlags.IgnoreCase)
If Not cat Is Nothing Then
cat.SetValue(att, False)
End If
End If
End If
Next
Hope this helps
source
share