-
.NET Core Version:
.Net 6
-
Have you experienced this same bug with .NET Framework?:
No, it works perfectly with the .Net Framework
Problem description:
I want to use a custom FileNameEditor for a custom control property. I derived from FileNameEditor like so:
public class MyFileNameEditor : System.Windows.Forms.Design.FileNameEditor
{
protected override void InitializeDialog(OpenFileDialog openFileDialog)
{
base.InitializeDialog(openFileDialog);
openFileDialog.Filter = "My files (*.custom)|*.custom";
}
}
I applied it like so:
[Editor(typeof(MyFileNameEditor ), typeof(System.Drawing.Design.UITypeEditor))]
public string MyFileName
{
set [...]
get [...]
}
In the VS designer, when selecting the custom control, inside the PropertyGrid, the property will have no editor.
Note that if I use the stock FileNameEditor instead, it just works.