如何通过选择其 unicode 将字体中的字符插入到树视图文本中?
我有一个带有树视图(MSComctlLib.TreeCtrl.2 类)的 Access 表单。树视图的字体已设置为“Courier New”,这对于我的目的来说是可以的。
我现在希望将此字体中的字符插入到特定节点的文本字符串值中;我检查了unicode U+2665(心形符号,十六进制表示法)在Courier New中可用,所以我认为以下内容应该没问题。
caption = Replace(Tags.Fields("Description"), "\H", ChrW(&H2665))
但树视图显示问号而不是预期的心形符号。
这里有什么问题吗?是否需要设置一些树视图属性 - 启用 unicode 字符规范?或者这可以不做吗?
I have an Access form with a treeview (class MSComctlLib.TreeCtrl.2) on it. The font of the treeview has been set to "Courier New" which is OK for my purposes.
I now wish to insert a character from this font into the text string value of a particular node; I checked that the unicode U+2665 (heart symbol, hex notation) is available in Courier New, so I thought the following would be OK.
caption = Replace(Tags.Fields("Description"), "\H", ChrW(&H2665))
But the treeview displays question marks instead of the expected heart symbols.
What is wrong here? Is there some treeview property to be set - enabling unicode char specification? Or can this not be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看评论;一般来说这是不可能的,因为提到的treeview类不支持unicode。下面提供的链接确实表明,例如使用日语字符集,可以添加一些 unicode 定义的字符。
要点是 unicode 2665 不会被解释为所需的心形符号,因为 26 和 65 已经是所有字符集中的有效字符。
http://www.example-code.com/vb/vbUnicode1.asp
顺便说一句,我注意到该页面上的一个链接无法正常工作 - 所以这里是另一个列出日语字符集的链接:
http://www.cs.nyu.edu/~yusuke/tools/unicode_to_shiftjis_or_ms932_table.html
See comments; in general it is not possible because the mentioned treeview class does not support unicode. The link supplied below does show that using for example the Japanese charset, it is possible to add some unicode defined characters.
Point is that unicode 2665 will not be interpreted as the required heart symbol, because 26 and 65 are valid characters in all charsets already.
http://www.example-code.com/vb/vbUnicode1.asp
By the way I noticed that one of the links on that page does not work properly - so here's another one listing the Japanese charset:
http://www.cs.nyu.edu/~yusuke/tools/unicode_to_shiftjis_or_ms932_table.html