Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8155857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:47:10+00:00 2026-06-06T16:47:10+00:00

How can I determine in KeyDown that ⇧ + Tab was pressed. private void

  • 0

How can I determine in KeyDown that ⇧ + Tab was pressed.

private void DateTimePicker_BirthDate_KeyDown(object sender, KeyEventArgs e)
{
   if (e.KeyCode == Keys.Tab && e.Modifiers == Keys.Shift)
   {
       //do stuff
   }
}

can’t work, because never both keys are pressed exactly in the same second. You always to at first the Shift and then the other one..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:47:14+00:00Added an answer on June 6, 2026 at 4:47 pm

    It can’t work, because never both keys are pressed exactly in the same second.

    You’re right that your code doesn’t work, but your reason is wrong. The problem is that the Tab key has a special meaning – it causes the focus to change. Your event handler is not called.

    If you use a different key instead of Tab, then your code will work fine.


    If you really want to change the behaviour of Shift + Tab for one specific control, it can be done by overriding ProcessCmdKey but remember that many users use the Tab key to navigate around the form and changing the behaviour of this key may annoy those users.

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
        if (DateTimePicker_BirthDate.Focused && keyData == (Keys.Tab | Keys.Shift))
        {
            MessageBox.Show("shift + tab pressed");
            return true;
        }
        else
        {
            return base.ProcessCmdKey(ref msg, keyData);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can determine the current number of connections by db.serverStatus().connections but all that gives
I'm interested in writing a log file analyzer that can determine the percentage of
from what i read i understand that iPhone can determine your location using Wi-Fi.
In ASP.NET MVC, is it possible to define routes that can determine which controller
Is there a way that I can determine the fragmentation of a single file
I want to create an application that can determine if some text was copied
I'm trying to implement application that can determine meaning of sentence, by dividing it
I've been writing a program that can determine any and every data about an
describe an algorithm that can determine the length of an array in O(log n).
I'm trying to teach myself some Prolog so that I can determine its fitness

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.