For example, there is a dataGridView, it has a keyDown event keyDown how to add the same event, for example, to individual cells, that is, cellKeyDown ?

  • one
    Unfortunately, there is no universal mechanism. If you do not have the source code of the class in which you want to add an event, then you will not succeed. In each case, you need to look at how to achieve this in alternative ways. For example, in your case, you can track the KeyDown event, check if you have a selected cell (or a cell in edit mode) and do what you need. If different recipients need to know about this event, then you can announce the event on the form and activate it in KeyDown. - Alexey Losev
  • one
    Describe what you want to achieve. Surely you want to disable / allow the input of certain characters. It is better to abandon this idea: such "help" always only prevents the user. For example, the user will not be able to paste text from the clipboard, etc. It is better to check the entered data using the CellValidating event. - Alexander Petrov
  • But if you really want, then you can (instead of TextChanged subscribe to KeyDown ). - Alexander Petrov

0