I have a datetimepicker in a windows application and i want to remove the extra space before the single digit day and month.
Is there any way to remove this extra space before day 2 and month 1?
I think you can not change/remove the spaces before the date and month values because your DateTimePicker is set to the custom format M/d/yyyy which displays Month and Date in single digit only(by leaving one digit space before month and date if they are less than 10).
as an alternative you can add Zero before month and date (if they are less than 10).
Try This:
dateTimePicker1.CustomFormat = "MM/dd/yyyy";
dateTimePicker1.Format = DateTimePickerFormat.Custom;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With