Am 20.06.2010 22:36, schrieb Mr. X.:
Also - propertyGrid may be a good solution, if I knew how to resolve by
propertyGrid all of the properties of selected control.
I can also only look in the documentation of the PropertyGrid
to find out which properties are shown by the property grid.
It says that public properites that don't have the BrowsableAttribute(False)
attached, are displayed.
Don't forget that properties can be inherited or not, can have
different access modifiers (public, private, etc) and they can be
static or instance members. You can pass the appropriate System.Reflection.BindingFlags
value(s) to the GetProperties method to get only the required
properties.
The code below returns 28 properties. I don't know if it's the 28 you've mentioned
in the other reply:
Dim t = GetType(PictureBox)
Dim tBrowsable = GetType(System.ComponentModel.BrowsableAttribute)
For Each prop In t.GetProperties(Reflection.BindingFlags.Public Or Reflection.BindingFlags.Instance)
Dim atts = prop.GetCustomAttributes(tBrowsable, False)
If atts.Length = 0 Then
Debug.Print(prop.Name)
End If
Next