Click here to Skip to main content
15,891,248 members
Articles / Desktop Programming / Windows Forms

A ComboBox with a CheckedListBox as a Dropdown

Rate me:
Please Sign up or sign in to vote.
4.87/5 (60 votes)
22 Nov 2008CPOL4 min read 660.3K   33.5K   110  
A ComboBox with a CheckedListBox as a dropdown
namespace CheckComboBoxTest {
    partial class Form1 {
        /// <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() {
            this.txtOut = new System.Windows.Forms.TextBox();
            this.ccb = new CheckComboBoxTest.CheckedComboBox();
            this.SuspendLayout();
            // 
            // txtOut
            // 
            this.txtOut.Location = new System.Drawing.Point(12, 162);
            this.txtOut.Multiline = true;
            this.txtOut.Name = "txtOut";
            this.txtOut.Size = new System.Drawing.Size(382, 132);
            this.txtOut.TabIndex = 1;
            // 
            // ccb
            // 
            this.ccb.CheckOnClick = true;
            this.ccb.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
            this.ccb.DropDownHeight = 1;
            this.ccb.FormattingEnabled = true;
            this.ccb.IntegralHeight = false;
            this.ccb.Location = new System.Drawing.Point(12, 22);
            this.ccb.Name = "ccb";
            this.ccb.Size = new System.Drawing.Size(382, 21);
            this.ccb.TabIndex = 0;
            this.ccb.ValueSeparator = ", ";
            this.ccb.DropDownClosed += new System.EventHandler(this.ccb_DropDownClosed);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(413, 306);
            this.Controls.Add(this.txtOut);
            this.Controls.Add(this.ccb);
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "CheckedComboBox Test";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private CheckedComboBox ccb;
        private System.Windows.Forms.TextBox txtOut;
    }
}

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)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions