Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. dateTimePicker1.Format = DateTimePickerFormat.Custom;
  2. dateTimePicker1.CustomFormat = " ";
  3.  
  4. public void CreateMyDateTimePicker()
  5. {
  6. // Create a new DateTimePicker control and initialize it.
  7. DateTimePicker dateTimePicker1 = new DateTimePicker();
  8.  
  9. // Set the MinDate and MaxDate.
  10. dateTimePicker1.MinDate = new DateTime(1985, 6, 20);
  11. dateTimePicker1.MaxDate = DateTime.Today;
  12.  
  13. // Set the CustomFormat string.
  14. dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd";
  15. dateTimePicker1.Format = DateTimePickerFormat.Custom;
  16.  
  17. // Show the CheckBox and display the control as an up-down control.
  18. dateTimePicker1.ShowCheckBox = true;
  19. dateTimePicker1.ShowUpDown = true;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement