Override the Form.ProcessCmdKey method, and check for the key there:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
Keys keyOnly = keyData & ~Keys.Modifiers;
Keys modifiersOnly = Control.ModifierKeys & (Keys.Shift | Keys.Control | Keys.Alt);
if (modifiersOnly == 0)
{
switch (keyOnly)
{
case Keys.F3:
...
return true;
}
}
return false;
}
This lets your form handle the key before it gets to any controls.
You then need to find the focussed control, but that's covered here:
.net - What is the preferred way to find focused control in WinForms app? - Stack Overflow[
^]
And you can then find the right cell for a DataGridView using the SelectedIndex and SelectedCells properties.