Simple string list in a property grid

  • Thread starter Thread starter michelqa
  • Start date Start date
M

michelqa

Hi,

I'm trying to display a list of string in the string collection editor
just like the "items" property of an ListBox in VS IDE....

I can find many examples on the net but I cant find any example like
items property of a listbox... I mean the String collection editor
with the text "Enter the strings in the collection (on per line)"

Is anybody can point me to the right object to use to define my string
collection object and/or a way to show the string collection editor
like ListBox items ??

Thanks,
 
To get that exact editor you need to apply the attribute:
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]

to the property, that however generates code like this:

this.listBox1.Items.AddRange(new object[] {
"sdfg",
"wef",
"wef",
"wef",
"wefwef",
"wef"});
 
THANKS!!!!!!!!!!!!!!!!

after loosing hours trying to find how to do this it finally works!!

Thanks again!
 
Back
Top