C
Christopher D. Wiederspan
I'm converting a .NET 2.0 Beta project to the final version using Visual
Studio. In doing so, I've come across a strange problem with the fonts in my
labels. To see the problem, I have an empty form with 2 labels, one "Timing
Details:" and one "Package Details:" - each one Bolded. When viewing the
form in design mode within Visual Studio, everything looks good - as
expected. But when I run the form, the word "Details" in each of the two
labels looks different. The second one looks scrunched up.
Here's the guts of my form code - nothing out of the ordinary as far as I
can tell:
partial class Form1 {
private void InitializeComponent() {
this.packageDetailsGroupLabel = new System.Windows.Forms.Label();
this.timeDetailsGroupLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// packageDetailsGroupLabel
//
this.packageDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.packageDetailsGroupLabel.Location = new System.Drawing.Point(12,
47);
this.packageDetailsGroupLabel.Name = "packageDetailsGroupLabel";
this.packageDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.packageDetailsGroupLabel.TabIndex = 22;
this.packageDetailsGroupLabel.Text = "Package Details:";
//
// timeDetailsGroupLabel
//
this.timeDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.timeDetailsGroupLabel.Location = new System.Drawing.Point(12, 9);
this.timeDetailsGroupLabel.Name = "timeDetailsGroupLabel";
this.timeDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.timeDetailsGroupLabel.TabIndex = 21;
this.timeDetailsGroupLabel.Text = "Timing Details:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(220, 79);
this.Controls.Add(this.packageDetailsGroupLabel);
this.Controls.Add(this.timeDetailsGroupLabel);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
private System.Windows.Forms.Label packageDetailsGroupLabel;
private System.Windows.Forms.Label timeDetailsGroupLabel;
}
If you have any ideas, or would like to see a screenshot of what I'm talking
about, please let me know.
Thanks,
Chris
Studio. In doing so, I've come across a strange problem with the fonts in my
labels. To see the problem, I have an empty form with 2 labels, one "Timing
Details:" and one "Package Details:" - each one Bolded. When viewing the
form in design mode within Visual Studio, everything looks good - as
expected. But when I run the form, the word "Details" in each of the two
labels looks different. The second one looks scrunched up.
Here's the guts of my form code - nothing out of the ordinary as far as I
can tell:
partial class Form1 {
private void InitializeComponent() {
this.packageDetailsGroupLabel = new System.Windows.Forms.Label();
this.timeDetailsGroupLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// packageDetailsGroupLabel
//
this.packageDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.packageDetailsGroupLabel.Location = new System.Drawing.Point(12,
47);
this.packageDetailsGroupLabel.Name = "packageDetailsGroupLabel";
this.packageDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.packageDetailsGroupLabel.TabIndex = 22;
this.packageDetailsGroupLabel.Text = "Package Details:";
//
// timeDetailsGroupLabel
//
this.timeDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.timeDetailsGroupLabel.Location = new System.Drawing.Point(12, 9);
this.timeDetailsGroupLabel.Name = "timeDetailsGroupLabel";
this.timeDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.timeDetailsGroupLabel.TabIndex = 21;
this.timeDetailsGroupLabel.Text = "Timing Details:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(220, 79);
this.Controls.Add(this.packageDetailsGroupLabel);
this.Controls.Add(this.timeDetailsGroupLabel);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
private System.Windows.Forms.Label packageDetailsGroupLabel;
private System.Windows.Forms.Label timeDetailsGroupLabel;
}
If you have any ideas, or would like to see a screenshot of what I'm talking
about, please let me know.
Thanks,
Chris