How to make the FullPath property of the Properties Grid editable
1. Add reference to System.Design2. Add a class module:
//FileNameEditor
override
class DllFileNameEditor
:
System.Windows.Forms.Design.FileNameEditor
{
protected
override void
InitializeDialog(OpenFileDialog
openFileDialog)
{
base.InitializeDialog(openFileDialog);
openFileDialog.Filter = "Class Library Files (*.dll) |*.dll|All (*.*)
|*.*";
openFileDialog.Title = "Select Class Library File";
}
}
3.Modify Property:
/// <summary>
/// Dll name
/// </summary>
[Category("Identity")]
[Description("Dll Location")]
[EditorAttribute(typeof(DllFileNameEditor),
typeof(System.Drawing.Design.UITypeEditor))]
public string DllName
{
get
{ return this.GraphDoc.DllName;
}
set
{ this.GraphDoc.DllName = value; }
}
Additional sources:
msdn
dotnet247.com