Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How I do to make a StringCollection property editable at design-time?

Use this custom editor attribute for the property that is of the StringCollection type (this can be used for other Collection types too if you want to allow entry of strings into the collection during design-time).

Editor( "System.Windows.Forms.Design.StringCollectionEditor, System.Design",
  "System.Drawing.Design.UITypeEditor, System.Drawing"), 
public CustomCollection CustomProp { get{ /*...*/ } set{ /*...*/ } } 

StringCollectionEditor is not public so you have to use the above constructor override and specify the type name. This editor should allow you to edit your collection without any problems.

Contributed from George Shepherd's Windows Forms FAQ



Page view counter