ASCII Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gsgurdeep
    New Member
    • Apr 2007
    • 94

    ASCII Code

    Please tell me the method of finding ASCII code for a giving letter in VB.Net program.

    Help Me.
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by gsgurdeep
    Please tell me the method of finding ASCII code for a giving letter in VB.Net program.

    Help Me.
    You can get key Code in KeyDown and KeyUp Events of a control
    and KeyAscii in KeyPress event

    use But Key Char is not available in KeyPress event

    [CODE=vbnet]intAsciiValue = Asc(Keys.KeyCha r)[/CODE]

    There is another Code like

    [CODE=vbnet]intAsciiValue = Keys.KeyCode[/CODE]

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      If you have an ASCII character, you can type-cast it to an int (or to a byte if you feel like it) and then look at the value.
      Here's a chart of the common ASCII character values
      http://www.ascii.ws/images/ascii-chart.gif

      Comment

      Working...