MGZ NetArt

Software Development and Support

Home
Design Patterns
C# Tips
AsyncCallback
Asynchronous Form.ShowDia
BackgroundWorker
Connection String
CopyTo() vs Clone()
Convert Color To String
Dispose vs Finalize
Debug mode
Delete Duplicate in SQL
Drag&Drop for TreeView
Edit Full Path Property
Hiding And Overriding
Polimorphism
How to use Resources
Run Time DLL
Simple Threading
Singleton Connection
Save Win Form as JPG File
Save Object in Registry
Soap Serialization
Sort and CompareTo
Working With List<>
Examples & Videos
MRDS Examples
Resume
Contact Us
How to make the FullPath property of the Properties Grid editable

1. Add reference to System.Design

2. 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