This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I want to use IntegerTextBox to represent a uint. It seems that this control is based on an int. How can I change it? Thanks |
|
|
IntegerTextBox will bind to a uint property just as it will to an int property. The CLR takes care of converting between them. The only issue will be if you need to use uint values that are greater than Int32.MaxValue. Is that the case? |
|
|
Yes I need values between 0 and 4294967295. This is for a field that represents a Unix user ID which can be an unsigned 32 bit integer. |
|
|
Ah, right. Unfortunately this is not currently possible, and we don't have an extensibility hook that would allow you to create a text box for an alternative integer type. The best I can suggest is that you use a NumericTextBox, which supports the full System.Decimal range, with DecimalPlaces set to 0 and EnforceDecimalPlaces set to true, and suitable Minimum and Maximum properties. Again, NumericTextBox will happily bind to a uint even though its Value property is declared as decimal. With DecimalPlaces set to 0 it won't show a decimal point so from the user point of view this should be indistinguishable from a "plain" integer box. |
|