How to make the number in the MaskedTextBox leading leading zeros left? Ie, I need the number 123 to look like 000123 If you set Mask = 999999, PromtChar = 0, then 123 is displayed as 123000, that is, zeros after the number and not before

    1 answer 1

    In my opinion the element is used for other purposes.

    Uses a mask to distinguish valid user input from invalid data.

    The mask is used to validate the entry of values. For formatted output, use

    string.Format("{0:D5}", 123); // 00123