Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Extend OpenFileDialog and SaveFileDialog the easy way

, 22 Mar 2012
Customize OpenFileDialog and SaveFileDialog using a User Control
CustomFileDialog_old.zip
CustomFileDialog
Properties
Settings.settings
FileDlgExtenders
Properties
CustomFileDialog_src2.zip
VB_Code
FileDlgExtenders
CSharp_Code
FileDlgExtenders
Properties
Properties
My Project
Settings.settings
My Project
Settings.settings
bin
release
bin
Debug
Release
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
Refactor
FileDlgExtenders.dll
TempPE
Release
Refactor
TempPE
CustomFileDialog_src_old.zip
c__projects_customfiledialog_src2.zip
Settings.settings
Settings.settings
DesignTimeResolveAssemblyReferencesInput.cache
FileDlgExtenders.dll
CustomFileDialog_src_old.zip
c__projects_release2.zip
FileDlgExtenders.dll
CustomOpenFileDialog.exe
release2.zip
FileDlgExtenders.dll
CustomOpenFileDialog.exe
using System.ComponentModel;
namespace CustomControls
{
    partial class MyOpenFileDialogControl
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MyOpenFileDialogControl));
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.pbxPreview = new System.Windows.Forms.PictureBox();
            this.lblColors = new System.Windows.Forms.Label();
            this.lblFormat = new System.Windows.Forms.Label();
            this.lblSize = new System.Windows.Forms.Label();
            this.lblSizeValue = new System.Windows.Forms.Label();
            this.lblFormatValue = new System.Windows.Forms.Label();
            this.lblColorsValue = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pbxPreview)).BeginInit();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.pbxPreview);
            this.groupBox1.Location = new System.Drawing.Point(5, 3);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(260, 261);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Preview";
            // 
            // pbxPreview
            // 
            this.pbxPreview.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pbxPreview.Location = new System.Drawing.Point(3, 16);
            this.pbxPreview.MaximumSize = new System.Drawing.Size(256, 256);
            this.pbxPreview.Name = "pbxPreview";
            this.pbxPreview.Size = new System.Drawing.Size(254, 242);
            this.pbxPreview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pbxPreview.TabIndex = 4;
            this.pbxPreview.TabStop = false;
            // 
            // lblColors
            // 
            this.lblColors.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblColors.Location = new System.Drawing.Point(5, 309);
            this.lblColors.Name = "lblColors";
            this.lblColors.Size = new System.Drawing.Size(42, 13);
            this.lblColors.TabIndex = 3;
            this.lblColors.Text = "Colors:";
            // 
            // lblFormat
            // 
            this.lblFormat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblFormat.Location = new System.Drawing.Point(5, 273);
            this.lblFormat.Name = "lblFormat";
            this.lblFormat.Size = new System.Drawing.Size(42, 13);
            this.lblFormat.TabIndex = 4;
            this.lblFormat.Text = "Format:";
            // 
            // lblSize
            // 
            this.lblSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblSize.Location = new System.Drawing.Point(5, 291);
            this.lblSize.Name = "lblSize";
            this.lblSize.Size = new System.Drawing.Size(42, 13);
            this.lblSize.TabIndex = 5;
            this.lblSize.Text = "Size:";
            // 
            // lblSizeValue
            // 
            this.lblSizeValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblSizeValue.Location = new System.Drawing.Point(50, 302);
            this.lblSizeValue.Name = "lblSizeValue";
            this.lblSizeValue.Size = new System.Drawing.Size(178, 13);
            this.lblSizeValue.TabIndex = 8;
            // 
            // lblFormatValue
            // 
            this.lblFormatValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblFormatValue.Location = new System.Drawing.Point(50, 284);
            this.lblFormatValue.Name = "lblFormatValue";
            this.lblFormatValue.Size = new System.Drawing.Size(178, 13);
            this.lblFormatValue.TabIndex = 7;
            // 
            // lblColorsValue
            // 
            this.lblColorsValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblColorsValue.Location = new System.Drawing.Point(50, 320);
            this.lblColorsValue.Name = "lblColorsValue";
            this.lblColorsValue.Size = new System.Drawing.Size(178, 13);
            this.lblColorsValue.TabIndex = 6;
            // 
            // MyOpenFileDialogControl
            // 
            this.Controls.Add(this.lblSizeValue);
            this.Controls.Add(this.lblFormatValue);
            this.Controls.Add(this.lblColorsValue);
            this.Controls.Add(this.lblSize);
            this.Controls.Add(this.lblFormat);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.lblColors);
            this.FileDlgCaption = "Select an Image";
            this.FileDlgDefaultViewMode = Win32Types.FolderViewMode.Thumbnails;
            this.FileDlgEnableOkBtn = false;
            this.FileDlgFileName = "Select Picture";
            this.FileDlgFilter = resources.GetString("$this.FileDlgFilter");
            this.FileDlgFilterIndex = 2;
            this.FileDlgOkCaption = "Select";
            this.FileDlgShowHelp = true;
            this.Name = "MyOpenFileDialogControl";
            this.Size = new System.Drawing.Size(270, 342);
            this.EventClosingDialog += new System.ComponentModel.CancelEventHandler(this.MyOpenFileDialogControl_ClosingDialog);
            this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.MyOpenFileDialogControl_HelpRequested);
            this.EventFolderNameChanged += new FileDialogExtenders.FileDialogControlBase.PathChangedEventHandler(this.MyOpenFileDialogControl_FolderNameChanged);
            this.EventFileNameChanged += new FileDialogExtenders.FileDialogControlBase.PathChangedEventHandler(this.MyOpenFileDialogControl_FileNameChanged);
            this.groupBox1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.pbxPreview)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Label lblColors;
        private System.Windows.Forms.PictureBox pbxPreview;
        private System.Windows.Forms.Label lblFormat;
        private System.Windows.Forms.Label lblSize;
        private System.Windows.Forms.Label lblSizeValue;
        private System.Windows.Forms.Label lblFormatValue;
        private System.Windows.Forms.Label lblColorsValue;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

dmihailescu
Software Developer (Senior)
United States United States
Decebal Mihailescu is a software engineer with interest in .Net, C# and C++.

| Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 22 Mar 2012
Article Copyright 2007 by dmihailescu
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid