Simple Usercontrol using Buttons

Oct 6 2011 7:29 AM
Hi All
Greetings
 
I am creating a simple usercontrol which has 5 buttons in it. I am developing this just to learn how to create a usercontrol. I am 5 button during runtime to a list and simultaneously to the usercontrol. I am adding it to the list so that i can edit those buttons using property grid. the code is as follows
 

private List<Button> bttns = new List<Button>();
 
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(typeof(BlitzHeaderPanelCollectionEditor),typeof(UITypeEditor))]
public List<Button> Bttns
{
      get{return bttns;}
}
 
int the initilisecomponent function i am adding 5 buttons programatically.
 
Now my issue is i am able to see those 5 buttons as collections in propertygrid 
if i edit them the changes take place during design time but when i run the program   the changes are wiped off to the defualt. Why is this happening. Please help me experts

Answers (1)