date time picker

  • Thread starter Thread starter Eva
  • Start date Start date
E

Eva

Hi,

i am using a datetimepicker to select a date and i want
this value to be inputted into a listbox. The problem im
ahving is i get the date and the time appearing. I only
require the date. Is there a way around this?
 
DateTimePicker' Value property holds actual DateTime value, while its Format
property determines how the DateTime value is displayed. You can also define
your own display format by using CustomFormat property.

In your case, now that you want to add DateTimePicker's value into a
ListBox, you simply do your own formating when add it to ListBox:

MyListBox.Items.Add(myDateTimePicker.Value.ToShortDateString());
 
Back
Top