BeppePix Posted April 21, 2005 Posted April 21, 2005 Hi all, in my class I declared a string-array property with the attributes to show it on PropertyGrid: <CategoryAttribute("Aspect"), _ Browsable(True), _ DescriptionAttribute("Insert text"), _ XmlAttributeAttribute()> _ Property StringPointer() As String() Get Return m_StringList End Get Set(ByVal Value() As String) Text = Value(0) m_StringList = DirectCast(Value.Clone, String()) End Set End Property It works but the PropertyGrid allows to modify the strings in two ways: 1. through the default String Editor that appear clicking the StringPointer property on the Grid and 2. each single string if you expand the property clicking on the 'plus' symbol. Now, because the whole array is the property, this last way doesn't reflect on the form that shows the strings. Is there a way to simply prevent the second way? Thanks for the attention. Quote
BeppePix Posted April 21, 2005 Author Posted April 21, 2005 I reply to myself, I think this will be useful... I added a new attribute <TypeConverter(GetType(CollectionConverter)), _ above the property definition and now there's just one way to modify the property by the PropertyGrid i.e. the string editor. I don't know if this is the best solution but it works. Any suggestion? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.