sirmilt
02-27-2003, 02:37 PM
Is there some trick to setting a custom format in the DateTimePicker in code? I can't seem to get it to work.
The situation is as follows:
There are 2 radio buttons that are used to tell the program that we want to refer to either a single month or a range of dates for reporting purposes.
If the user clicks the month button, I want the DateTime Picker to return them month as MMMM yyyy. if the user clicks the period button I want the DateTime Picker to return an exact date as MMMM d, yyyy. The following code has no effect:
dtpPeriod.Format=dtpCustom
dtpPeriod.CustomFormat = "MMMM yyy"
This returns a Short Date.
What have i missed?
The situation is as follows:
There are 2 radio buttons that are used to tell the program that we want to refer to either a single month or a range of dates for reporting purposes.
If the user clicks the month button, I want the DateTime Picker to return them month as MMMM yyyy. if the user clicks the period button I want the DateTime Picker to return an exact date as MMMM d, yyyy. The following code has no effect:
dtpPeriod.Format=dtpCustom
dtpPeriod.CustomFormat = "MMMM yyy"
This returns a Short Date.
What have i missed?