Multi-line string in a PropertyGrid

后端 未结 4 1960
走了就别回头了
走了就别回头了 2020-12-15 16:23

Is there a built-in editor for a multi-line string in a PropertyGrid.

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-15 16:46

    No, you will need to create what's called a modal UI type editor. You'll need to create a class that inherits from UITypeEditor. This is basically a form that gets shown when you click on the ellipsis button on the right side of the property you are editing.

    The only drawback I found, was that I needed to decorate the specific string property with a specific attribute. It's been a while since I had to do that. I got this information from a book by Chris Sells called "Windows Forms Programming in C#"

    There's a commercial propertygrid called Smart PropertyGrid.NET by VisualHint.

提交回复
热议问题