WinForms TextBox doesn't reliably display non-spacing Unicode character that displays properly in a CheckedListBox

38 Views Asked by At

Currently, my code generates a list of strings from selected options that can contain the non-spacing Unicode "Combining Double Breve Below" and then displays those strings in a textbox. As seen in the screenshot, the character is displayed correctly in the CheckedListBox to the left (i͜y) but is not displayed in the TextBox to the right (iy). I setup the TextBox to be prefilled with all possible combinations (that I use at least) and it appears that half of them don't render at all while some do but appear shifted to the right. Both controls are using the same Times New Roman 18pt Font, and the issue does not resolve itself by making the TextBox Bold like the ListBox.

Screenshot of application displaying character correctly in CheckedListBox control, and incorrectly in a TextBox control

I've verified that the tie-bar character is a part of the string in Visual Studio's debugger.

I've tried changing the font, the same issue happens with Segoe UI as with Times New Roman.

I've tried replacing the TextBox with a RichTextBox with no change in results.

I've tried setting the TextBox through the Text property and through the Lines property with no difference.

I've tried adding letters around the items in the CheckedListBox to see if that would break it, but again it renders perfectly inside that control.

Any help or suggestions would be greatly appreciated.

0

There are 0 best solutions below