OpenNETCF DateTimePicker V1.3

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

So I'm trying to use the OpenNETCF (V1.3) DateTimePicker to display and make
pickable the date and the time in a single control. I'm setting the
following properties:

this.dtpEventStart.CustomFormat = "MM/dd/yyyy hh:mmtt";
this.dtpEventStart.Format =
OpenNETCF.Windows.Forms.DateTimePickerFormat.Custom;

While the date and time are visible in the designer, when I run the
application only the date appears and is pickable in the control. Is there
some way I can have my cake and eat it too or am I going to have to use
separate controls for date and for time?

Bill
 
In a Form constructor where you set dtpEventStart, the control is not
created yet thus it didn't work. The problem can be solved by moving:

dtpEventStart.Format =
OpenNETCF.Windows.Forms.DateTimePickerFormat.Custom;

into the Load event of your form.
 
Back
Top