⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.designer.cs

📁 通过重写C#中的ComboBox类
💻 CS
字号:
namespace CustomColoredComboBox
{
    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.coloredComboBox1 = new CustomColoredComboBox.ColoredComboBox();
            this.SuspendLayout();
            // 
            // coloredComboBox1
            // 
            this.coloredComboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
            this.coloredComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.coloredComboBox1.FormattingEnabled = true;
            this.coloredComboBox1.Items.AddRange(new object[] {
            "Black",
            "Red",
            "Blue",
            "Green",
            "Pink",
            "DarkRed",
            "Yellow",
            "Orange"});
            this.coloredComboBox1.Location = new System.Drawing.Point(12, 12);
            this.coloredComboBox1.MyColors = new string[] {
        "Black",
        "Red",
        "Blue",
        "Green",
        "Pink",
        "DarkRed",
        "Yellow",
        "Orange",
        "x"};
            this.coloredComboBox1.Name = "coloredComboBox1";
            this.coloredComboBox1.Size = new System.Drawing.Size(103, 21);
            this.coloredComboBox1.TabIndex = 0;
            this.coloredComboBox1.SelectedIndexChanged += new System.EventHandler(this.coloredComboBox1_SelectedIndexChanged);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(242, 173);
            this.Controls.Add(this.coloredComboBox1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }

        #endregion

        private ColoredComboBox coloredComboBox1;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -