0
votes

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?

1
Those implementations of the common controls are not unicode aware AFAIK - Alex K.
Seems you're right. When I test it with a text box, assigning ChrW(&H2665), it shows the heart symbol all right, but not so in the tree node text - pity but I will probably have to go use a richer treeview then. - Maestro13
Found a link pointing in the same direction: see treeview control not unicode-enabled - Maestro13

1 Answers

0
votes

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