Application not allows to modify a custom numeric property (sorted using CodeDomSerializer)

Hello,
In my previous posthttp://forums.microsoft.com/msdn/ShowPost.aspx?PostID=54512, I don't know how to sort the properties at design time. Now, the properties are ordered ok, but the user can't to update a numeric property. The application show the message:
"Invalid property value. Specified argument was out of the range of valid values.
Parameter name: Index was out of range. Must be non-negative and less than the size of the collection."
See image: (the image shows the error when the user attemps to set the vale 5 to the Buttons property).

This issue only its fired when the user attemps to update numeric properties.
I need help here.
Regards and TIA.
[1150 byte] By [CFQüeb] at [2007-12-16]
# 1

Ok dudes,

I found the solution to my problem: I'm using the LastIndexOf() function of an Array with the CodeDom statements, but i was using this function without the initial index defined like an argument to search. See the code attached for more details. For newbies in this topic, CodeDom is useful when you need to control the code generation at design time by the IDE (if you are developing components or custom controls). The code only shows the CodeDom implementation in a class. I write this code because i need that some properties become placed at the top of the anther properties.

CodeDomSerialize result:

// Acme Company.ItemGroups:RadioButton personalizado para X2005

//

// itemGroups1

this.itemGroups1.ValuesToReturn = null;
this.itemGroups1.SpaceBetweenButtons = 1;
this.itemGroups1.SelectedForeColor = System.Drawing.Color.White;
this.itemGroups1.SelectedBackColor = System.Drawing.Color.Navy;
this.itemGroups1.ReadOnlyForeColor = System.Drawing.Color.White;
this.itemGroups1.ReadOnlyBackColor = System.Drawing.Color.WhiteSmoke;
this.itemGroups1.DataValue = 0;
this.itemGroups1.ReadOnly = false;
this.itemGroups1.Captions = null;
this.itemGroups1.Buttons = 5;
// this properties aren't sorted via codedom
this.itemGroups1.AddedButtons = true;
this.itemGroups1.BackColor = System.Drawing.Color.Transparent;
this.itemGroups1.Ismodified = false;
this.itemGroups1.Location = new System.Drawing.Point(161, 84);
this.itemGroups1.Name = "itemGroups1";
this.itemGroups1.Size = new System.Drawing.Size(104, 20);
this.itemGroups1.SupportThemes = false;
this.itemGroups1.TabIndex = 10;
this.itemGroups1.Text = null;

You can view the code like images:

Images removed for long time ago...

CFQüeb at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Designer...