那些个是在组件编辑器内部创建子元素时才能看到的不能独立的从工具栏上拖放, 也不会出现在工具栏上.选中菜单或工具栏, 调出属性窗口, Items 等属性中, 添加那里有.

解决方案 »

  1.   

    using System;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication1
    {
        public class Form1 : Form
        {
            private ToolStrip toolStrip1;
            private ToolStripComboBox toolStripComboBox1;
        
            public Form1()
            {
                InitializeComponent();
            }
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.Run(new Form1());
            }        private void InitializeComponent()
            {
                toolStrip1 = new System.Windows.Forms.ToolStrip();
                toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox();
                toolStrip1.SuspendLayout();
                SuspendLayout();
                // 
                // toolStrip1
                // 
                toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                toolStripComboBox1});
                toolStrip1.Location = new System.Drawing.Point(0, 0);
                toolStrip1.Name = "toolStrip1";
                toolStrip1.Size = new System.Drawing.Size(292, 25);
                toolStrip1.TabIndex = 0;
                toolStrip1.Text = "toolStrip1";
                // The following code example demonstrates the syntax for setting
                // various ToolStripComboBox properties.
                // 
                toolStripComboBox1.AutoCompleteCustomSource.AddRange(new string[] {
                "aaa",
                "bbb",
                "ccc"});
                toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
                toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
                toolStripComboBox1.DropDownHeight = 110;
                toolStripComboBox1.DropDownWidth = 122;
                toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
                toolStripComboBox1.IntegralHeight = false;
                toolStripComboBox1.Items.AddRange(new object[] {
                "xxx",
                "yyy",
                "zzz"});
                toolStripComboBox1.MaxDropDownItems = 9;
                toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert;
                toolStripComboBox1.Name = "toolStripComboBox1";
                toolStripComboBox1.Size = new System.Drawing.Size(121, 25);
                toolStripComboBox1.Sorted = true;
                // 
                // Form1
                // 
                ClientSize = new System.Drawing.Size(292, 273);
                Controls.Add(toolStrip1);
                Name = "Form1";
                toolStrip1.ResumeLayout(false);
                toolStrip1.PerformLayout();
                ResumeLayout(false);
                PerformLayout();        }
        }
    }
    ToolStripComboBox 直接在代码里面用
    后面那个不知道你说的是什么控件。没有见过
      

  2.   

    Dobzhansky老兄,你说的“选中菜单或工具栏, 调出属性窗口, Items 等属性中, 添加那里有”,我实在是不会操作,在工具栏中右键都看不到属性窗口的。能否再详细与在下说一次,谢谢。
      

  3.   

    选中界面上的 toolStrip , 按 F4, 出现属性窗口, 找到 Items 属性, 点击省略号, 弹出的窗口中左上有个下拉列表, 选择 Combobox, 新增, 增加的就是 ToolStripComboBox 类型的 item.
      

  4.   

    多谢2位了,ToolStripComboBox 已经添加上了,程序可以用了.以后还请2位多多赐教