Larry
Larry

Reputation: 18031

Add an edit text dropdown in a property grid

I am writing a class whose properties are accessed through a property panel, one of these properties is a multiline text.

I want a dropdown to be displayed in the designer of this property panel so that the user fills out a multiline text, the same way a Label or the a TextBox does in Visual Studio.

This is what I want in my property panel

Which attribute should I put above my property definition to allow this ?

Upvotes: 3

Views: 725

Answers (1)

John Arlen
John Arlen

Reputation: 6689

You want to decorate the "Text" property with System.ComponentModel.Design.MultilineStringEditor.

e.g.

[Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public string Text { .... }

Upvotes: 2

Related Questions