[如果我有一个TreeView,其字体为Segoa UI Emoji。我需要使用2个字符串设置TreeView节点图标,但不起作用。另外,如果Unicode仅具有4位数字,例如unicodeEndStr
,我可以为下面的2639
变量使用什么值?
// This code shows emoji icon in treeview node followed by a space and some text
string emoji = "\U0001F608" + " " + "Face Savoring Food";
EmojiTreeView.Nodes.Add(emoji);
// This code does not show emoji icon, just \U0001F608 followed by a space and some text
string unicodeStartStr = "\\U000"; // need double back slashes to compile
string unicodeEndStr = "1F608";
string emojiCodeStr = unicodeStartStr + unicodeEndStr;
string emojiStr = emojiCodeStr + " " + "Face Savoring Food";
EmojiTreeView.Nodes.Add(emojiStr);