Click to See Complete Forum and Search --> : Creating Expandable Property


CrettonFabian
September 27th, 2002, 01:21 AM
First of all, i have no real good information about how to create properties in a Window Form. I mean a new property that will be managed throught the Property Editor. The only things i found are some articles on some programming site.

Adding a simple property (bool, int) works fine without a lot of work, but what i want to create now is an expandable property, the one that appear in the Property Editor with a '+' in front.

So I want to add an Expandable property to a WindowForm in C#. Then, i inherit from this C# form in a VB.NET project.

I found a simple example on another site, and i could give the reference if someone wanting to help me need it.

I created a new class with the
[TypeConverter(typeof(ExpandableObjectConverter))]
Actually i really have NO information about TypeConverter and such stuffs...

And in my WindowsFrom, i created the property based on an instance of this class, using the :
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

The property appears in the Property Editor, and I can change the values there, but the values are never stored. It means that if i close this VB Form and open it again, the values come back to 0. Actually, when modifying this Expandable property, no code is added in the InitializeComponent Method, and i can also see that the set method of the property is never called (i put a MessageBox.Show inside).

So...hope that someone can help ;-)
have a nice day anyway
fabian