How do I get a unicode symbol/emoji to appear in a listbox in C#? -


the user can "lock" item on listbox prevent being altered. i'm trying symbol '🔒' (unicode 1f512) appear next item, keep getting square '◻'. appears in microsoft visual studio in editor, font consolas. changed font consolas in listbox, , tried number of other fonts, none of them worked.

it should work out of box default font microsoft sans serif.

the following code works me. it's not production quality, proving point.

private void form1_load(object sender, eventargs e) {     listbox1.items.add("🔒"); }  private void buttonunlock_click(object sender, eventargs e) {     listbox1.items[0] = listbox1.items[0].tostring().replace("🔒", ""); }  private void buttonappend_click(object sender, eventargs e) {     listbox1.items[0] += "🔒"; } 

at first thought problem language/font settings if visual studio editor able show unicode characters correctly, doesn't seem case.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -