Monday 3 June 2013

Date Picker in WPF

I currently have a program that takes the value from a datePicker and have the date saved as a string. I only needed the date not the time so i used the following code to save the date value:
DateTime StartDate;
String inMyString;
savedDate = datePicker1.SelectedDate.Value.Date;
inMyString =   savedDate.Date.ToShortDateString()


<DatePicker Height="25" HorizontalAlignment="Left" Margin="42,26,0,0" Name="datePicker1"
            VerticalAlignment="Top" Width="115" />

No comments:

Post a Comment