Say I have attribute "Address", how can I make it's input in the form designer's property box like that of a text box's text input, like so:
?
Say I have attribute "Address", how can I make it's input in the form designer's property box like that of a text box's text input, like so:
?
Decorate your Address
property with an EditorAttribute referencing the MultilineStringEditor class:
using System.ComponentModel;
using System.Drawing.Design;
[Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
typeof(UITypeEditor))]
public string Address
{
get;
set;
}
This happens through a "designer". For System.Windows.Forms.TextBox
that designer is:
[Designer("System.Windows.Forms.Design.TextBoxDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), SRDescription("DescriptionTextBox"), ComVisible(true), ClassInterface(ClassInterfaceType.AutoDispatch)]
If you want to view its source code, open up .NET Reflector, Open Cache... System.Design, navigate (or search) to System.Windows.Forms.Design.TextBoxDesigner
.
UPDATE: Since 2014, the .NET Core is open-source, check out the official repository site