Detect the Tab Key Press in TextBox

前端 未结 2 1549
天涯浪人
天涯浪人 2021-02-07 12:42

I am trying to detect the Tab key press in a TextBox. I know that the Tab key does not trigger the KeyDown, KeyUp or the

2条回答
  •  滥情空心
    2021-02-07 13:35

    you can used this code for tab are presed...

     private void input_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        { 
            //Check here tab press or not
            if (e.KeyCode == Keys.Tab)
            {
               //our code here
            }
            //Check for the Shift Key as well
            if (Control.ModifierKeys == Keys.Shift && e.KeyCode == Keys.Tab) {
    
            }
        }
    

提交回复
热议问题