1

env: VS2019 16.6.3 on Windows Server 2008 R2 x64

Reproduce steps:

  1. create a normal .net4.0 winform project
  2. drag a CheckBox on Form1
  3. add a new form (auto name to Form2)
  4. drag two LinkLabels and a Label on Form2, make sure the z-order is: linkLabel1, linkLabel2, label1
  5. set linkLabel1 and linkLabel2 font to Arial, 10.5pt
  6. register the Load event for Form2, write codes:
    linkLabel2.Text = string.Empty;
    linkLabel1.Text = "<未选择>";
    linkLabel2.Text = "<未选择>";
    
  7. modify Main method contents to follow codes in program.cs:
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    
    new Form1().ShowDialog();
    Application.Run(new Form2());
    
  8. F5, close Form1, now you can see the linkLabel1 width is not enough

demo.zip

enter image description here

I do reported to Developer Community, but based on my past experience, they prefer close, so i decided post here too.

ahdung
  • 350
  • 3
  • 13
  • *They* don't prefer to close, *They* prefer to fix what can be fixed, possibly without disrupting existing applications. These fixes often come with Framework updates. Try FW 4.8. Btw, 10.5 is an *odd* Font size. – Jimi Aug 24 '20 at 05:21
  • this issue not only about font size, every step is important. – ahdung Aug 24 '20 at 05:47
  • It looks fine on `Windows 8.1`, not cutoff. In your screenshot, the `label1` font looks like `Courier New`, which may indicate the OS fonts are limited. As long as `AutoSize = true` is set, then it should work as expected, unless the `OS` is reporting the wrong size. Maybe there is an update or service pack that fixed this issue. – Loathing Aug 24 '20 at 05:58
  • my OS lang is chinese, `label1` font and size are default, no problem.@Loathing – ahdung Aug 24 '20 at 06:41
  • this issue is not about display, it's about width value, `linkLabel1.Width` is `49`, `linkLabel2.Width` is `65`, I running it on Win10, same issue.@Loathing – ahdung Aug 24 '20 at 06:53
  • @ahdung You may have noticed (or not), that Arial doesn't provide any Japanese symbol. So, how does the Control show Japanese kanji if the Font doesn't have any? Read a bout Font Fallback here, for example: [How can a Label control display Japanese characters properly when the Font used doesn't support this language?](https://stackoverflow.com/a/51612395/7444103). .Net Framework (and the System) has had a number of updates, some quite recent, to support Asian symbols, specifically tied to the size of these symbol. When dealing with Font Fallback and Asian languages, some extra care is needed. – Jimi Aug 24 '20 at 08:16
  • @Jimi I think not the reason, `linkLabel2` no problem. – ahdung Aug 24 '20 at 09:32

0 Answers0