Windows.forms.keys collection

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi all,

I have the below code for sending each character in a string as a Keys.x enumeration. I've found that when I convert the char, it does not match the enumeration item index and thereby generates a very random output. Any ideas on how I can convert chars to their right equivalent in the Keys enumeration.

thanks,

as an example:

Dim strCaseID As String = "s"


For Each c As Char In strCaseID
Dim key As UInteger = Convert.ToInt16(c)
DoKeyBoard(0, key)
DoKeyBoard(NativeMethods.KEYEVENTF.KEYUP, key)

Next


in this example s is somehow translated into 115 and this translates to Keys.F4, which actually should be an 83 to be indicated right..

.



Relevant Pages

  • Re: Alternative to Enum string values as return types and parameters
    ... What I would do is use an enumeration with numbers. ... the string that is passed in the constructor. ... > public enum HOW_GOOD ... The dataset table results will have the char value too. ...
    (microsoft.public.dotnet.languages.csharp)
  • [PATCH 09/21] perf: rewire generic library stuff, p5
    ... +int eprintf(int level, const char *fmt, ...) ... * Helper function for splitting a string into an argv-like array. ... +static int count_argc(const char *str) ...
    (Linux-Kernel)
  • Re: How to add thousand separators
    ... First, this code is obsolete as written, because char is a dead data type and should not ... Note that both of these should be stored as string resources since they might need to be ... 18 digits for any reason. ... you have made a VERY SERIOUS DESIGN ERROR. ...
    (microsoft.public.vc.mfc)
  • Re: Returning a character buffer from a DLL
    ... I need to return a string buffer from the DLL in a RunQuery function. ... I find it odd that you are using the obsolete 'char *' data type here. ... want to use a string pointer of any type here! ...
    (microsoft.public.vc.mfc)
  • Re: what is the best way of passing floats into a string
    ... I do not null-terminate as snprintf takes care of this (according to ... But the easiest way to determine the size needed to format a number, ... int length_of_representation(double n,const char* format){ ... I get a nice result of -10.000000 in my char * string. ...
    (comp.unix.programmer)