I have a DateTimePicker
on my form. I'd like part of the format to include "today", "tomorrow" etc as appropriate. I've got a simple implementation to work out the value (and there are much better ones here) but I'd like to take that implementation and put the value directly into the CustomFormat
property of the DateTimePicker
.
For example, given the following format:
dateTimePicker.CustomFormat = "dd MMM yyyy (YTT) HH:mm";
To produce the following display at runtime on 16th April 2011 at 12:00:
"16 Apr 2011 (today) 12:00"
I expect this is something involving building a IFormatProvider
/ICustomFormatter
implementation and hacking customising the CurrentCulture
to use it.
Many thanks in advance.