Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get leading zeros displayed in a RadixNumericTextBox when using a Hexadecimal RadixBase%3F

Solved!
Go to solution

How do I get leading zeros displayed in a RadixNumericTextBox when using a Hexadecimal RadixBase in Visual Studio 2010, C# and Measurement Studio 2012?

0 Kudos
Message 1 of 2
(5,511 Views)
Solution
Accepted by topic author gcsd_dano

Besides the RadixBase property, there is no member available on RadixNumericTextBox to customize the display of the formatted value. However, you can override the FormatValue method to provide custom formatting logic:


    public class CustomRadixNumericTextBox : RadixNumericTextBoxInt32 {
        protected override string FormatValue( int value ) {
            string formatted = base.FormatValue( value );
            return formatted.PadLeft( 8, '0' );
        }
    }

~ Paul H
Message 2 of 2
(5,503 Views)