How to change format (e.g. dd/MMM/yyyy) of DateTimePicker in WPF application

后端 未结 9 2165
春和景丽
春和景丽 2020-12-14 03:52

I want to Change the Format of date selected in DateTimePicker in WPF Application

9条回答
  •  無奈伤痛
    2020-12-14 04:03

    Try This

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
          DateLabel.Content = Convert.ToDateTime(datePicker1.Text).ToString("dd-MM-yyyy");
        }
    

提交回复
热议问题