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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:16:41+00:00 2026-06-14T05:16:41+00:00

I have several groupBoxes-controls with a NumericUpDown-control in each on of them. The NumericUpDowns

  • 0

I have several groupBoxes-controls with a NumericUpDown-control in each on of them. The NumericUpDowns have a small modification – they can also decrement in the negative range of decimal. Here is the code:

//Add KeyDown event to the numericUpDown control
numericUpDownGBPC12_angleRange.KeyDown += new KeyEventHandler(numericUpDownNegative);

The code of the function numericUpDownNegative is as follows:

void numericUpDownNegative(object sender, KeyEventArgs e)
{
    NumericUpDown temp = (NumericUpDown)sender;
    temp.Value -= temp.Increment;
    sender = (object)temp;
    NumericUpDown temp = (NumericUpDown)sender;
}

Suggestions for improving the code above are most welcome however I’m more interested if it is possible to enable negative input in a NumericUpDown. The above code works but when I try to put a negative number I get something weird. This behaviour does not apply for a non-modified NumericUpDown.

Example:
Let’s say numericUpDownGBPC12_angleRange has a minimum of -70.0000000000 and a maximum of 70.0000000000, which I have set by the Minimum/Maximum property parameters of the control. The starting value of the control is 0.0000000000. If I push the Down-button, I get accordingly -0.0000000001, -0.0000000002, -0.0000000003 etc. until I reach -70.0000000000. However if I decide to type -x.xxxxxxxxxx (let’s say -24.2398324119) I get x-0.0000000000 (4-0.0000000000). So not only I cannot enter the full number 24 (it seems the NumericUpDown takes the last typed digit in this case, which is 4), but I get the whole part after the point completely annihilated unless it was set by using the case in which case the problem is only with the part before the point. So only the first digit (on the most left of the number) can be changed. :-/

I was thinking of using textBox-controls however the amount of number fields I have as part of the interface will create a huge overhead because of the parsing of each and every textBox (we all know that sadly many users love to experiment with things that where never intended to be experimented with ;)) to make sure a certain number is entered. Despite the negative-thingy the NumericUpDown has really nice feature such as – only a digit can be entered and you can also specify the precision, the range of values etc.

So again the question is – is it possible for a NumericUpDown to accept negative input by the user?

  • 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-14T05:16:42+00:00Added an answer on June 14, 2026 at 5:16 am

    Problem was in the KeyDown-event (had to remove it completely) and also in the format I was trying to input as a number. I have the ‘,’ seperator and not the ‘.’ in my Visual Studio (due to localization). So typing ‘.’ made the NumericUpDown go berserk.

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

Sidebar

Related Questions

I have a form with several groupboxes, each containing controls several checkboxes. I want
I have several 2-dimentional arrays under a hdf5 file, how can I merge them
we have several tens of macro enabled excel files, each of those contains few
I have several Select which depend on each other if I select a value
I have several foreach loops after each other in a larger foreach loop.. What
I have several problems relating to NSPredicates, here are they; 1.) My code is
I have several small place marks such as 'א,א' 'א,ב'. If we use the
I have several different user controls that get built dynamically and added to a
I have several classes that I serialize/deserialize, each with a number of properties, some
I have several Rails Active Record Models: ContactEmails, ContactCalls, ContactPostalcards. Each one represent a

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.