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

  • SEARCH
  • Home
  • 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 8381391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:41:18+00:00 2026-06-09T16:41:18+00:00

I use these following codes to work with numpad keys. if (e.KeyCode == Keys.NumPad0

  • 0

I use these following codes to work with numpad keys.

if (e.KeyCode == Keys.NumPad0 || e.KeyCode == Keys.D0)
{
   MessageBox.Show("You have pressed numpad0");
}
if (e.KeyCode == Keys.NumPad1 || e.KeyCode == Keys.D1)
{
   MessageBox.Show("You have pressed numpad1");
}

And also for the other numpad keys. But I want to know how I can to this for “+” , “*” , “/” , ” -” , ” . ” which located next to the numpad keys.

Thanks in advance

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

    For “+” , “*” , “/” , we can use KeyDown event and for “-” , “.” we can use KeyPress event.

    Here are the codes :

    private void button1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Add)
            {
                MessageBox.Show("You have Pressed '+'");
            }
            else if (e.KeyCode == Keys.Divide)
            {
                MessageBox.Show("You have Pressed '/'");
            }
            else if (e.KeyCode == Keys.Multiply)
            {
                MessageBox.Show("You have Pressed '*'");
            }
        }
    private void button1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '.')
            {
                MessageBox.Show("You have pressed '.'");
            }
            else if (e.KeyChar == '-')
            {
                MessageBox.Show("You have pressed '-'");
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following use-case: there are several assemblies decorated with ProtoContract classes and I
I have the following use case: There's a class called Template and with that
I have use these code to upload two images in folder of the root
I use these codes to convert Gregorian calendar to Julian calendar and there's no
I have been following this great tutorial and got my codes to working with
At my place of work, we have an ASP.NET page that uses the following
I have created custom MembershipUser, MembershipProvider and RolePrivoder classes. These all work and I
I have the following code that I'm using in a small frame work I've
I use node.js as REST API. There are following actions available: /contacts, GET, finds
Take the following article for example: http://weblogs.asp.net/psteele/archive/2009/11/23/use-dependency-injection-to-simplify-application-settings.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+dotnetmvp+%28Patrick+Steele%27s+.NET+Blog%29 I don't see what benefit there is

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.