J'ai 4 continus ToolStripStatusLabel dans statusStrip et leur est un espace entre eux, l'exigence est comme ça nous n'avons pas besoin d'espace entre ces 4 ToolStripStatusLabel dans statusStrip. S'il vous plaît dites-moi comment nous pouvons supprimer l'espace entre eux .. J'ai une alternative pour définir toutes les valeurs dans un statusStrip mais comme toutes les valeurs proviennent de diverses sources, c'est un changement majeur. donc s'il vous plaît fournissez-moi la solution (j'utilise C# .net - vs2005)Comment faire pour supprimer l'écart entre deux éléments de statusStrip dans C# .net (vs 2005)
0
A
Répondre
5
Vous pouvez modifier la propriété de marge des ToolStripStatusLabels, même aux nombres négatifs: Par exemple, essayez '-2; 3; -2; 2 ', cela va rapprocher les objets. Attention à ne pas trop s'approcher pour éviter les chevauchements.
Pour clarifier les choses, ce que je veux dire la propriété, un exemple de code (concepteur généré):
/// <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();
}
2
Essayez de définir la marge gauche et à droite de votre ToolStripStatusLabels à une valeur négative. Vous devrez juste expérimenter un peu pour voir quelle valeur exacte vous donne la position que vous recherchez.
Wow, c'était proche. –