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 9172385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:20:00+00:00 2026-06-17T16:20:00+00:00

I have a simple increment on textbox by pressing down arrow key which are

  • 0

I have a simple increment on textbox by pressing down arrow key which are as below.

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{

     if (keyData == Keys.Down)
     {

           int c = int.Parse(textBox1.Text);
           c++;
           textBox1.Text = c.ToString();


     }
 }

The above works on pressing double down arrow key instead of single pressing down arrow key.

Note: The above code is on UserControl. And I have tried it on simple winform application on form keydown EventHandller and the same is works fine.

How to overcome?.

  • 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-17T16:20:01+00:00Added an answer on June 17, 2026 at 4:20 pm

    You’ll need to handle other commands that existed before and return when you handle ones you are looking for. Try changing it to this and see if that helps:

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
       if (msg.WParam.ToInt32() == (int)Keys.Down)
       {
          int c = int.Parse(textBox1.Text);
          c++;
          textBox1.Text = c.ToString();
          return true;
       }
       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 have a simple table , contains a primary key which has an Auto
as a simple example, i have a C function which receives an int,increment it
I have simple class with width and height member fields which define number of
for a simple pointer-increment allocator (do they have an official name?) I am looking
I have a simple table as below. CREATE TABLE `stats` ( `id` int(11) NOT
I have a hopefully simple MySQL query question which is eluding me at late
Uh..... I have no idea why this simple code snippet isn't working: function increment()
I have written simple first stage bootloader which displays Hello world using interrupt to
I have a simple system in which photos have many comments. I'm sure I'm
I have a simple script which I have included here. the select query works

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.