Jim,
Use Systems.Windows.Forms.Keys ... it has properties for a lot of the "special" keys.
~~Bonnie
>Rex,
>
> On the main Window of the application I have a treeview. I want to program the ability to refresh the treeview when the user hits F5 on the keyboard. There is not an ascii code for this key. If I create a menu option that uses the F5 key when the treeview has focus nothing happens, but if another form has focus and I hit the F5 key I get the results I want to. How do I get the F5 key to work from the treeview?
>
>Jim
>
>>>Rex,
>>>
>>> Thanks for the response. If the 13 an ascii keycode? Where would I find those?
>>>
>>>Jim
>>>
>>>>>All,
>>>>>
>>>>> I am writing a Windows application and need to trap keys being pressed. I know there is a keypress event but am unsure how to determine which key is pressed. How would I do this?
>>>>Hi Jim,
>>>>
>>>>We use the following example
>>>>
>>>>// If the enter key is pressed
>>>>if (e.KeyChar == (char)13)
>>>>{
>>>> this.btnOK.PerformClick();
>>>>}
>>Jim,
>>
>>Just do a search in the help for Ascii Codes. The page title is ASCII Character Codes. It will give you two pages.