简体   繁体   中英

Character limit on typing/pasting hex into numericupdown

Im trying to build a winform at the moment. I need a box to enter a hexidecimal byte offset (ie should be capable of holding a 64 bit number).

I had thought a numericupdown would work but it seems to have a 32 bit limit. Is there a way around this or a more suitable approach somebody could suggest?

Update:

The 32 bit (8 character) limit refers to typing/pasting a value into the box.

NumericUpDown.Value is a decimal

http://msdn.microsoft.com/en-us/library/364x0z75.aspx

10^28 is about 2^100 (so 100 bits for mantissa) so 64 bits are ok

If you try this piece of code on a just created numericupdown works fine...

        numericUpDown1.Maximum = UInt64.MaxValue;
        numericUpDown1.Value = numericUpDown1.Maximum;

EDIT: if you set the flag for hex you can't use UInt64 but only Int64. I missed it... Anyway, Int64 is ok.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM