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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:04:19+00:00 2026-05-12T18:04:19+00:00

In my C#.Net WinForm app in VS2005, I have a NumericUpDown control. In the

  • 0

In my C#.Net WinForm app in VS2005, I have a NumericUpDown control. In the designer, I set the Minimum property of the NumericUpDown to -65535.

In the form’s .designer.cs code, I expected to see this:

this.myNumericUpDown.Minimum = -65535;

but instead I get:

    this.myNumericUpDown.Minimum = new decimal(new int[] {
    65535,
    0,
    0,
    -2147483648}); 

I know what this means from looking up the int32[] decimal constructor, but why does the designer use that form instead of putting the value I entered, or even using the int32 decimal constructor?

  • 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-05-12T18:04:20+00:00Added an answer on May 12, 2026 at 6:04 pm

    In theory the designer could store your original input text. Yet since the visual designer can also modify these values (i.e. Left, Top, etc) it would have to reconcile this storage against the control’s values during serialization. This is presumably one reason why the designer does not store the text values entered, rather it takes your text and converts it to a value that can be placed into the control. When it needs to serialize it just reads the control’s properties and writes them. There would little point to interrogate the details of the decimal prior to storage just to optimize which constructor to use. It needs to handle all possible values of the decimal type, thus the int[] provides a round-trip reliable storage mechanic for any value a decimal can represent.

    BTW, the following outlines the internal structure of the decimal:

    • bits is a four-element array of 32-bit signed integers.
    • bits [0], bits [1], and bits [2] contain the low, middle, and high 32 bits of the 96-bit integer number.
    • bits [3] contains the scale factor and sign, and consists of following parts:
      • Bits 0 to 15, the lower word, are unused and must be zero.
      • Bits 16 to 23 must contain an exponent between 0 and 28, which indicates the power of 10 to divide the integer number.
      • Bits 24 to 30 are unused and must be zero.
      • Bit 31 contains the sign; 0 meaning positive, and 1 meaning negative.

    Update:

    Would you explain “…since the visual designer can also modify these values, … it would have to reconcile this storage against the control’s values during serialization…” in more detail?

    Sure. I was just trying to address the literal interpretation of your question “why does the designer use that form instead of putting the value I entered“. Basically all I’m saying is that the designer doesn’t keep track of the exact textual value you entered “-65535”. Instead, it converts it to a decimal with something like decimal.Parse(…). Then it places this decimal into the control’s value, in this case NumericUpDown.Minimum. Afterwords it serializes the state of the control in the xxxx.Designer.cs file by reading each property value. Thus it no longer has a copy of the original text “-65535” you entered, but only the resulting decimal value.

    The part referring to “reconcile this storage…” was to simply to point out that it would be difficult to not only track the original text input by a user, but also detect if that value had been changed by some other means that the original text input.

    Sorry if that is still confusing I’m having trouble describing it. English is my 5th language, right behind C#, C++, SQL, and JScript all of which are much more explicit in meaning than English 🙂

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

Sidebar

Related Questions

This is my first winform app in .NET... I have made a couple of
I have an .NET 4 .exe (Winform Desktop app) to which I have added
I have the following situation: .net 3.5 WinForm client app accessing SQL Server 2008
I have a .NET Winforms app (created in VS2005) that I deploy using ClickOnce.
I'm working on a legacy vb.net winform app, and would like to have have
I have a WinForm .NET 2.0 framework app that works fine in Vista, Win
I have a groupox in a VB.NET winform app. The groupbox contains a few
I have a WinForm App(.Net 3.5) that we use in house for data entry...ish,
I have created a setup project in VS2008. My WinForms app uses .NET 2.0,
In VS2008, in a VB.NET windows (WInform) app, I suddenly seem to not be

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.