preesing F3 key and cathcing the event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,
i writing a windows application in C#. i have a text box and i want to catch the F3 keypreess event
how can i do it? what is the currect syntax

and how can i catch it when the foucus is on the dataGrid??

thank you alll
 
Gidi,

You will want to hook up to the KeyDown or the KeyUp event (depending on
which makes sense to you). In that event, you can check the KeyCode
property of the KeyEventArgs instance passed into the event to see if the
value contains Keys.F3 (it is a bitmask, so more than one value can be
specified).

Hope this helps.
 
Hi
As for the datagrid , you can use the focused event to execute code when
the grid get the focus. As for the key stoke there are some built in as (
all the function keys ) so there is not problem assigning any of these to a
control using the controls' visual properties ,other than these defined
keys you will need to use a windows API function call to catch that

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top