i use a textbox inside my windows form application and i need to disable the shortcuts CTRL+I and CTRL+H. I tried many different solutions i found via google but it won't work.
I use CTRL+I already as a custom shortcut in my app and i do not want to have a tabstop inserted by this command inside my textbox. For whatever reason CTRL+H acts like pressing delete?
If i set "Shortcuts enabled" to false in the properties of the control CTRL+I and CTRL+H are still working. CTRL+C or CTRL+V is disabled then. I would expect that all shortcuts are turned off if i set "Shortcuts enabled" to false.
I tried the following code i found somewhere but it also does not prevent CTRL+I or CTRL+H
private void textBoxComment_KeyDown(object sender, KeyEventArgs e)
{
if ( e.Modifiers == Keys.Control )
{
switch(e.KeyCode)
{
case Keys.C:
case Keys.X:
case Keys.V:
case Keys.Z:
case Keys.I:
case Keys.H:
e.Handled = true;
break;
default:
break;
}
}
}