Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unicode in Rich Text Box

126 views
Skip to first unread message

Harald Witt

unread,
Mar 2, 2005, 6:04:26 AM3/2/05
to
Hello,

in VB6 the RTB is a control which accept Unicode.

I want to write in my RTB: "Diameter <= 10"
But for "<=" I want to use the Unicode 2265 (less equal character).

How can I do that?
Thanks in advance!

Harald


Tony Proctor

unread,
Mar 2, 2005, 6:48:04 AM3/2/05
to
Visual basic uses Unicode internally. However, I believe the VB controls
(RichTextBox included) use an ANSI character set internally.

You can try and push this Unicode character into your RichTextBox, e.g.

RichTextBox1.Text = ChrW(2265)

However, it will very likely appear as just a fall-back "?" if the symbol is
not available in the current font. If this is true for you, you could try
changing the .Font.Charset property

Tony Proctor

"Harald Witt" <hw...@novasoftware.de> wrote in message
news:uafXYcx...@TK2MSFTNGP14.phx.gbl...

Harald Witt

unread,
Mar 2, 2005, 8:05:21 AM3/2/05
to
Hello Tony,

I tried your suggestion with ChrW(8804), but it don't work.
Don't know why?

Then I found these piece of code to write one character to the RTB and this
works:

Dim Data As SETTEXTEX
Data.flags = ST_DEFAULT
Data.codepage = CODEPAGE_UNICODE
Call SendMessage(c.hWnd, EM_SETTEXTEX, VarPtr(Data), UCode)

Is there an easier way to write Unicode text in a RTB?

Harald


0 new messages