PropertyGrid TypeConverter
-
Hi Does anyone know what TypeConverter to use to open a OpenFileDialog from the propertygrid? Thank you, D
-
Hi Does anyone know what TypeConverter to use to open a OpenFileDialog from the propertygrid? Thank you, D
Hi D this is the code: [Browsable(true), Description("The filename for destination.")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FileName { get {return _FileName;} set {_FileName = Path.GetFileName(value);} }
-
Hi D this is the code: [Browsable(true), Description("The filename for destination.")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FileName { get {return _FileName;} set {_FileName = Path.GetFileName(value);} }
Hi Joe Thank you
-
Hi Joe Thank you
you can also create your own editor class. 1. create a new class and implement the openfiledialogeditor. override the initialize methode (this methode have 1 parameter e.g. the openfiledialog) now, in the methode you can set your own properties e.g title, filter .... 2. change the editorattribute in the property to your class [Browsable(true), Description("The filename for the destination.")] [EditorAttribute(typeof(MyNamespace.MyFileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string FileName { get {return _FileName;} set {_FileName = Path.GetFileName(value);} }