DateTimePicker.ShowCheckBox DateTimePicker.ShowCheckBox DateTimePicker.ShowCheckBox DateTimePicker.ShowCheckBox Property

Definición

Obtiene o establece un valor que indica si se muestra una casilla a la izquierda de la fecha seleccionada.Gets or sets a value indicating whether a check box is displayed to the left of the selected date.

public:
 property bool ShowCheckBox { bool get(); void set(bool value); };
public bool ShowCheckBox { get; set; }
member this.ShowCheckBox : bool with get, set
Public Property ShowCheckBox As Boolean

Valor de propiedad

true si se muestra una casilla a la izquierda de la fecha seleccionada; en caso contrario, false.true if a check box is displayed to the left of the selected date; otherwise, false. De manera predeterminada, es false.The default is false.

Ejemplos

En el ejemplo de código siguiente se crea una nueva DateTimePicker instancia de un control y se inicializa.The following code example creates an new instance of a DateTimePicker control and initializes it. Se establece la CustomFormat propiedad del control.The control's CustomFormat property is set. Además, la ShowCheckBox propiedad se establece para que el control muestre un CheckBox, y la ShowUpDown propiedad se establece para que el control se muestre como un control de botón de número (también conocido como control de flechas).Also, the ShowCheckBox property is set so that the control displays a CheckBox, and the ShowUpDown property is set so that the control is displayed as a spin button control (also known as an up-down control).

public:
   void CreateMyDateTimePicker()
   {
      // Create a new DateTimePicker control and initialize it.
      DateTimePicker^ dateTimePicker1 = gcnew DateTimePicker;
      
      // Set the MinDate and MaxDate.
      dateTimePicker1->MinDate = DateTime(1985,6,20);
      dateTimePicker1->MaxDate = DateTime::Today;
      
      // Set the CustomFormat string.
      dateTimePicker1->CustomFormat = "MMMM dd, yyyy - dddd";
      dateTimePicker1->Format = DateTimePickerFormat::Custom;
      
      // Show the CheckBox and display the control as an up-down control.
      dateTimePicker1->ShowCheckBox = true;
      dateTimePicker1->ShowUpDown = true;
   }
public void CreateMyDateTimePicker()
{
   // Create a new DateTimePicker control and initialize it.
   DateTimePicker dateTimePicker1 = new DateTimePicker();

   // Set the MinDate and MaxDate.
   dateTimePicker1.MinDate = new DateTime(1985, 6, 20);
   dateTimePicker1.MaxDate = DateTime.Today;

   // Set the CustomFormat string.
   dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd";
   dateTimePicker1.Format = DateTimePickerFormat.Custom;

   // Show the CheckBox and display the control as an up-down control.
   dateTimePicker1.ShowCheckBox = true;
   dateTimePicker1.ShowUpDown = true;
}
   
Public Sub CreateMyDateTimePicker()
    ' Create a new DateTimePicker control and initialize it.
    Dim dateTimePicker1 As New DateTimePicker()
    
    ' Set the MinDate and MaxDate.
    dateTimePicker1.MinDate = New DateTime(1985, 6, 20)
    dateTimePicker1.MaxDate = DateTime.Today
    
    ' Set the CustomFormat string.
    dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd"
    dateTimePicker1.Format = DateTimePickerFormat.Custom
    
    ' Show the CheckBox and display the control as an up-down control.
    dateTimePicker1.ShowCheckBox = True
    dateTimePicker1.ShowUpDown = True
End Sub 'CreateMyDateTimePicker

Comentarios

Cuando la ShowCheckBox propiedad está establecida en true, se muestra una casilla a la izquierda de la fecha en el control.When the ShowCheckBox property is set to true, a check box is displayed to the left of the date in the control. Cuando la casilla está activada, el valor de fecha y hora se puede actualizar.When the check box is selected, the date/time value can be updated. Cuando la casilla está desactivada, no se puede cambiar el valor de fecha y hora.When the check box is cleared, the date/time value is unable to be changed.

Se aplica a