我的一个ToolStrip上有四个ToolStripButton控件,分别为:添加,修改,删除,关闭
现在我想把:添加,修改,删除设为一个组,关闭单独为一个组.这个怎么设啊,里面没有属性,知道的大哥帮帮小弟.感激不尽
谢谢~

解决方案 »

  1.   


    ZengHD已经说的很清楚了吧LZ你在Designer中,拖入一个ToolStrip控件,然后就可以在上面添加Button,Label,SplitButton,Seperator等等等等。如果要代码的话,也是Designer自动生成的
    private void InitializeComponent()
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
                this.toolStrip1 = new System.Windows.Forms.ToolStrip();
                this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
                this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
                this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
                this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
                this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
                this.toolStrip1.SuspendLayout();
                this.SuspendLayout();
                // 
                // toolStrip1
                // 
                this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.toolStripButton1,
                this.toolStripButton2,
                this.toolStripButton3,
                this.toolStripSeparator1,
                this.toolStripButton4});
                this.toolStrip1.Location = new System.Drawing.Point(0, 0);
                this.toolStrip1.Name = "toolStrip1";
                this.toolStrip1.Size = new System.Drawing.Size(292, 25);
                this.toolStrip1.TabIndex = 0;
                this.toolStrip1.Text = "toolStrip1";
                // 
                // toolStripButton1
                // 
                this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
                this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.toolStripButton1.Name = "toolStripButton1";
                this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
                this.toolStripButton1.Text = "toolStripButton1";
                // 
                // toolStripButton2
                // 
                this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
                this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.toolStripButton2.Name = "toolStripButton2";
                this.toolStripButton2.Size = new System.Drawing.Size(23, 22);
                this.toolStripButton2.Text = "toolStripButton2";
                // 
                // toolStripButton3
                // 
                this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
                this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.toolStripButton3.Name = "toolStripButton3";
                this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
                this.toolStripButton3.Text = "toolStripButton3";
                // 
                // toolStripButton4
                // 
                this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
                this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.toolStripButton4.Name = "toolStripButton4";
                this.toolStripButton4.Size = new System.Drawing.Size(23, 22);
                this.toolStripButton4.Text = "toolStripButton4";
                // 
                // toolStripSeparator1
                // 
                this.toolStripSeparator1.Name = "toolStripSeparator1";
                this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(292, 266);
                this.Controls.Add(this.toolStrip1);
                this.Name = "Form1";
                this.Text = "Form1";
                this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                this.toolStrip1.ResumeLayout(false);
                this.toolStrip1.PerformLayout();
                this.ResumeLayout(false);
                this.PerformLayout();        }