John
John

Reputation: 7910

how to get character code

hello Is it possible to get character character code in Visual Basic 2008 and to get character from character code ( Without form1_keyDown or KeyUp)?.

What i need is two functions, first to get character code of a character, and second to get character from character code.

thank you.

Upvotes: 1

Views: 15667

Answers (2)

Konrad Rudolph
Konrad Rudolph

Reputation: 545923

From Unicode code point (not, strictly speaking, ASCII) to character: Chr and ChrW.

Inverse direction: Asc and AscW.

To get the character representation in specific encodings you need to use the methods of the System.Text.Encoding class.

Upvotes: 10

Daniel Protopopov
Daniel Protopopov

Reputation: 7236

From MSDN:

Public Function Chr(ByVal CharCode As Integer) As Char
Public Function ChrW(ByVal CharCode As Integer) As Char

Upvotes: 5

Related Questions