0

I am writing a Chinese GUI program using Visual Studio.

I have already tested this character on Visual Studio 2008 and 2017.
This problem happen in both version.

The character I was using is (\u6236).
The Font size become smaller when it is in the Form like Label, TextBox, Button text.
However, the character's size does not change in the Title Bar, Status Bar or Menu bar.

Can someone explain why this happen?

Cannot post image yet so I put down a link here.
As you can see, only this character become smaller.

enter image description here

partial class Form1
{
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        this.button1 = new System.Windows.Forms.Button();
        this.checkBox1 = new System.Windows.Forms.CheckBox();
        this.label1 = new System.Windows.Forms.Label();
        this.listView1 = new System.Windows.Forms.ListView();
        this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
        this.textBox1 = new System.Windows.Forms.TextBox();
        this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
        this.toolTip2 = new System.Windows.Forms.ToolTip(this.components);
        this.toolStrip1 = new System.Windows.Forms.ToolStrip();
        this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
        this.statusStrip1 = new System.Windows.Forms.StatusStrip();
        this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
        this.toolStrip1.SuspendLayout();
        this.statusStrip1.SuspendLayout();
        this.SuspendLayout();
        // 
        // button1
        // 
        this.button1.Location = new System.Drawing.Point(7, 131);
        this.button1.Name = "button1";
        this.button1.Size = new System.Drawing.Size(75, 23);
        this.button1.TabIndex = 0;
        this.button1.Text = "住戶";
        this.button1.UseVisualStyleBackColor = true;
        // 
        // checkBox1
        // 
        this.checkBox1.AutoSize = true;
        this.checkBox1.Location = new System.Drawing.Point(7, 160);
        this.checkBox1.Name = "checkBox1";
        this.checkBox1.Size = new System.Drawing.Size(47, 17);
        this.checkBox1.TabIndex = 1;
        this.checkBox1.Text = "住戶";
        this.checkBox1.UseVisualStyleBackColor = true;
        // 
        // label1
        // 
        this.label1.AutoSize = true;
        this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.5F);
        this.label1.Location = new System.Drawing.Point(4, 180);
        this.label1.Name = "label1";
        this.label1.Size = new System.Drawing.Size(28, 15);
        this.label1.TabIndex = 2;
        this.label1.Text = "住戶";
        // 
        // listView1
        // 
        this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
        this.columnHeader1});
        this.listView1.Location = new System.Drawing.Point(7, 28);
        this.listView1.Name = "listView1";
        this.listView1.Size = new System.Drawing.Size(121, 97);
        this.listView1.TabIndex = 3;
        this.listView1.UseCompatibleStateImageBehavior = false;
        this.listView1.View = System.Windows.Forms.View.Details;
        // 
        // columnHeader1
        // 
        this.columnHeader1.Text = "住戶";
        // 
        // textBox1
        // 
        this.textBox1.Location = new System.Drawing.Point(7, 198);
        this.textBox1.Name = "textBox1";
        this.textBox1.Size = new System.Drawing.Size(100, 20);
        this.textBox1.TabIndex = 4;
        this.textBox1.Text = "住戶";
        // 
        // toolStrip1
        // 
        this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.toolStripLabel1});
        this.toolStrip1.Location = new System.Drawing.Point(0, 0);
        this.toolStrip1.Name = "toolStrip1";
        this.toolStrip1.Size = new System.Drawing.Size(800, 25);
        this.toolStrip1.TabIndex = 5;
        this.toolStrip1.Text = "toolStrip1";
        // 
        // toolStripLabel1
        // 
        this.toolStripLabel1.Name = "toolStripLabel1";
        this.toolStripLabel1.Size = new System.Drawing.Size(32, 22);
        this.toolStripLabel1.Text = "住戶";
        // 
        // statusStrip1
        // 
        this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.toolStripStatusLabel1});
        this.statusStrip1.Location = new System.Drawing.Point(0, 428);
        this.statusStrip1.Name = "statusStrip1";
        this.statusStrip1.Size = new System.Drawing.Size(800, 22);
        this.statusStrip1.TabIndex = 6;
        this.statusStrip1.Text = "statusStrip1";
        // 
        // toolStripStatusLabel1
        // 
        this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
        this.toolStripStatusLabel1.Size = new System.Drawing.Size(32, 17);
        this.toolStripStatusLabel1.Text = "住戶";
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(800, 450);
        this.Controls.Add(this.statusStrip1);
        this.Controls.Add(this.toolStrip1);
        this.Controls.Add(this.textBox1);
        this.Controls.Add(this.listView1);
        this.Controls.Add(this.label1);
        this.Controls.Add(this.checkBox1);
        this.Controls.Add(this.button1);
        this.Name = "Form1";
        this.Text = "住戶";
        this.toolStrip1.ResumeLayout(false);
        this.toolStrip1.PerformLayout();
        this.statusStrip1.ResumeLayout(false);
        this.statusStrip1.PerformLayout();
        this.ResumeLayout(false);
        this.PerformLayout();
    }

    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.CheckBox checkBox1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.ListView listView1;
    private System.Windows.Forms.ColumnHeader columnHeader1;
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.ToolTip toolTip1;
    private System.Windows.Forms.ToolTip toolTip2;
    private System.Windows.Forms.ToolStrip toolStrip1;
    private System.Windows.Forms.ToolStripLabel toolStripLabel1;
    private System.Windows.Forms.StatusStrip statusStrip1;
    private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
}
Jimi
  • 29,621
  • 8
  • 43
  • 61
vmia159
  • 3
  • 2
  • Does the Font you're using for those controls contain these `住戶` symbols? – Jimi Nov 10 '18 at 05:30
  • It doesn't, "Microsoft Sans Serif" always invokes font-fallback. Outcome is unpredictable, looks to me the fallback for those two glyphs use different fonts. The title and toolstrip use the system default font, Segoe UI for the past decade. So easy fix, change the form's Font property to Segoe. Or any other font that is more apt at Chinese glyphs: https://en.wikipedia.org/wiki/List_of_CJK_fonts – Hans Passant Nov 10 '18 at 12:48
  • Notes on font-fallback: [How can Label control display Japanese characters properly when font of the label doesn't support Japanese characters?](https://stackoverflow.com/questions/51608365/how-can-label-control-display-japanese-characters-properly-when-font-of-the-labe?answertab=active#tab-top) – Jimi Nov 10 '18 at 14:08
  • It works perfectly on Segoe UI. Thank you very much. – vmia159 Nov 12 '18 at 02:18

1 Answers1

0

I believe the issue you are having is to do with the auto scaling that windows performs to ensure correct scale on different screen sizes.

Have a read of Automatic scaling in Windows Forms

It maybe relevant to what your experiencing.

Mark
  • 2,454
  • 4
  • 26
  • 29
  • If this is the case I was experiencing, I think a global scale problem will be happened. In the same label, I think all the character inside should have the same font size. – vmia159 Nov 10 '18 at 03:38