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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:08:51+00:00 2026-06-11T11:08:51+00:00

EDITED: I would like to know how to use the KeyPress event on the

  • 0

EDITED:
I would like to know how to use the KeyPress event on the Form, I want to write a program that the user can input values (float values) from the keyboard only by pressing the keys (number only) and this values must to be saved inside label.Text. I already tried to read the documentation Control.KeyPress Event from MSDN I it did not helped me, I’m new in programming and because of that please explain the code you wrote (if you answer the question with code) so I can learn with it.

I know it’s possible to use the KeyPress Event in a TextBox, but it’s not my objective.

  • 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-11T11:08:52+00:00Added an answer on June 11, 2026 at 11:08 am

    You can not get the event from the label. because labels doesn’t get focus on forms .

    Fore receiving inputs from keyboard you should write your code on your form’s Control.KeyPress Event and change the keyPreview property of your form to true. so you can always get the keyboard inputs .

    first set

    yourform.KeyPreview = true;
    

    and after write your code on KeyPress event like:

    private void yourform_KeyPress(object sender, KeyPressEventArgs e)
    {
        //write your code here
    }
    

    Now you can get all the keyboard inputs on your form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how I can use Python to concatenate multiple Javascript
i would like to know , how ill know which inlines forms was edited?
I would like to have questions marked as Edited, but I dont know what
I'd like to know, how I can use php's function mode_rewrite correctly. I'm currently
I want to know the status of a process. I think I can use
I would like to validate that a username is not already in use when
I have a form which is dynamically generated based on user input. Initially the
(edited) I want to display a dynamic list of JPanels that hold textfield that
I'm trying to use if inside a pipeline. I know that there is where
I'm working on a rather large Asp.net MVC3 project and would like to use

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.