dimanche 29 mars 2015

Winforms TextBox margin? space difference

I have observed that the margin setting for the TextBox has no apparent affect (even though I wish it did) on the control. However, I wrote a simple test program using a TextBox and it has a different margin! I have carefully compared my two programs and there is no relevant difference between them but one has only two pixels from the edge to the first character entered in the TextBox and the other has seven pixels! Is there an explanation for this discrepancy?


The designer settings are identical in both programs:



this.textBox1.AcceptsReturn = true;
this.textBox1.AcceptsTab = true;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.HideSelection = false;
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Margin = new System.Windows.Forms.Padding(0);
this.textBox1.MaxLength = 0;
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;

Aucun commentaire:

Enregistrer un commentaire