I want to pass the ASCII value of a keystroke to a sub that checks for valid
characters (see sample below). I have looked through the possible choices
for "values" of the e.KeyChar but I can't find what I need? I am trying to
adapt an old VB6 routine so it may well be that I am going at this the wrong
way for .NET"
Any suggestions appreciated.
================= Sample Code ==============
Private Sub txtEqpVoc_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtEqpVoc.KeyPress
DecCheck(txtEqpVoc.Text, e.KeyChar.????)
End Sub
Imran Koradia - 23 Oct 2004 19:21 GMT
You can use the Asc function:
DecCheck(txtEqpVoc.Text, Asc(e.KeyChar))
hope that helps..
Imran.
>I want to pass the ASCII value of a keystroke to a sub that checks for
>valid
[quoted text clipped - 12 lines]
>
> End Sub
Herfried K. Wagner [MVP] - 23 Oct 2004 19:52 GMT
"Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> schrieb:
> I want to pass the ASCII value of a keystroke to a sub
> that checks for valid characters (see sample below). I have
> looked through the possible choices for "values" of the
> e.KeyChar but I can't find what I need?
> [...]
> DecCheck(txtEqpVoc.Text, e.KeyChar.????)
'AscW(e.KeyChar)', 'Asc(e.KeyChar)', 'Convert.ToInt32(c)'.

Signature
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/
Wayne Wengert - 23 Oct 2004 20:53 GMT
hanks guys... that is what I needed - I was trying the wrong approach!
Wayne
> I want to pass the ASCII value of a keystroke to a sub that checks for valid
> characters (see sample below). I have looked through the possible choices
[quoted text clipped - 10 lines]
>
> End Sub