Simple string list in a property grid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • michelqa

    Simple string list in a property grid

    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,
  • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

    #2
    RE: Simple string list in a property grid

    To get that exact editor you need to apply the attribute:
    [Editor("System. Windows.Forms.D esign.ListContr olStringCollect ionEditor,
    System.Design, Version=2.0.0.0 , Culture=neutral ,
    PublicKeyToken= b03f5f7f11d50a3 a", typeof(UITypeEd itor))]

    to the property, that however generates code like this:

    this.listBox1.I tems.AddRange(n ew object[] {
    "sdfg",
    "wef",
    "wef",
    "wef",
    "wefwef",
    "wef"});

    --
    Ciaran O''Donnell
    try{ Life(); } catch (TooDifficultException) { throw Toys(); }



    "michelqa" wrote:
    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,
    >

    Comment

    • michelqa

      #3
      Re: Simple string list in a property grid

      THANKS!!!!!!!!! !!!!!!!

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

      Thanks again!

      Comment

      Working...