How to code while pressing the Ctrl+Tab Key in Windows Form?

How to code while pressing the Ctrl+Tab Key in Windows Form

Thanks,


Answer this question

How to code while pressing the Ctrl+Tab Key in Windows Form?

  • Thomas Lindquist

    Hi,

    You need to add a event handler for the KeyDown Event. In the InitializeComponent, add the EventHandler as follows:

    this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);

    Inside the EventHandler you can check for the KeyCombination as follows:



    private
    void Form1_KeyDown(object sender, KeyEventArgs e)
    {
       if (Keys.Tab == e.KeyCode && e.Control)
      {
         MessageBox.Show("CTRL + TAB Key Pressed");
      }
    }

     


    R
    egards,
    Vikram



  • SuperFox

    Thanks, Vikram

  • How to code while pressing the Ctrl+Tab Key in Windows Form?