The problem is a bit deeper than that, your Sub, even though it is named MakbuzTDataGridView_KeyDown, it actually does not have an event handler. So nothing is calling it ever, not even if you are inside the DataGridView.