如何删除c#.net中两个statusStrip项之间的差距(vs 2005)

Dr.*_*len 0 c# statusstrip

我在statusStrip中有4个连续的ToolStripStatusLabel,它们之间是空格,要求就是我们在statusStrip中的这4个ToolStripStatusLabel之间不需要任何空格.

请告诉我如何删除它们之间的空间..我有一个替代方法可以在一个statusStrip中设置所有值,但是因为所有值都来自各种来源所以它是一个重大变化.所以请为我提供解决方案(我正在使用c#.net - vs2005)

Sim*_* D. 5

您可以更改ToolStripStatusLabels的margin-property,甚至更改为负数:例如,尝试'-2; 3; -2; 2',这将使物品靠得更近.注意不要太靠近,以避免重叠.

为了澄清,我的意思是什么属性,一些示例代码(设计者生成):

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        this.statusStrip1 = new System.Windows.Forms.StatusStrip();
        this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
        this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
        this.statusStrip1.SuspendLayout();
        this.SuspendLayout();
        // 
        // statusStrip1
        // 
        this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.toolStripStatusLabel1,
        this.toolStripStatusLabel2});
        this.statusStrip1.Location = new System.Drawing.Point(0, 240);
        this.statusStrip1.Name = "statusStrip1";
        this.statusStrip1.Size = new System.Drawing.Size(284, 22);
        this.statusStrip1.TabIndex = 0;
        this.statusStrip1.Text = "statusStrip1";
        // 
        // toolStripStatusLabel1
        // 
        this.toolStripStatusLabel1.Margin = new System.Windows.Forms.Padding(-3, 3, -3, 2);
        this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
        this.toolStripStatusLabel1.Size = new System.Drawing.Size(25, 17);
        this.toolStripStatusLabel1.Text = "123";
        // 
        // toolStripStatusLabel2
        // 
        this.toolStripStatusLabel2.Margin = new System.Windows.Forms.Padding(-3, 3, -3, 2);
        this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
        this.toolStripStatusLabel2.Size = new System.Drawing.Size(25, 17);
        this.toolStripStatusLabel2.Text = "234";
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(284, 262);
        this.Controls.Add(this.statusStrip1);
        this.Name = "Form1";
        this.Text = "Form1";
        this.statusStrip1.ResumeLayout(false);
        this.statusStrip1.PerformLayout();
        this.ResumeLayout(false);
        this.PerformLayout();

    }
Run Code Online (Sandbox Code Playgroud)