Inserting a Unicode character into a RichTextBox

Wibs

Member
Joined
Jan 16, 2009
Messages
20
Programming Experience
Beginner
Hi,

I want to insert a special character into a RichTextBox. The character is in a Medieval Latin font (Andron) which is installed on my machine.

When I open MS Word and select Andron as the font, then go to Insert Symbol, then scroll down till I find the symbol I want, I see that its Unicode value is A752, selecting it inserts it into Word OK.

Now, back to my VB2005 project: I have a RichTextBox on my form, and the Font is set to Andron. I have two buttons on the form. Behind the first button I have this simple code:

RichTextBox1.Text = RichTextBox1.Text.Insert(RichTextBox1.SelectionStart, "a")

Clicking this button simply inserts the letter 'a' at the insertion point, fine.

Behind the second button I have this code:

RichTextBox1.Text = RichTextBox1.Text.Insert(RichTextBox1.SelectionStart, ChrW(&HA752))

However, on clicking this button I get the ubiquitous square symbol, as if it cannot find that character, which is odd (to me) as the correct font is selected for the RTB, and that code is the correct code for the symbol I want.

Can anyone see what I am doing wrong here?

Edit to add: I can now see that all characters up to Ascii (Decimal) 255 (which equates to Unicode 00FF) all display OK, but any value over that does not. Any ideas why?

Wibs
 
Last edited:
Back
Top