Aracılığıyla paylaş


DateTimePicker.ShowCheckBox Özellik

Tanım

Seçili tarihin solunda onay kutusunun görüntülenip görüntülenmeyeceğini belirten bir değer alır veya ayarlar.

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

Özellik Değeri

Boolean

true seçili tarihin solunda bir onay kutusu görüntüleniyorsa; aksi takdirde , false. Varsayılan değer: false.

Örnekler

Aşağıdaki kod örneği, bir denetimin yeni bir DateTimePicker örneğini oluşturur ve başlatır. Denetimin CustomFormat özelliği ayarlanır. Ayrıca özelliği, denetimin ShowCheckBox bir CheckBoxgörüntülemesi için ayarlanır ve ShowUpDown özellik, denetimin bir döndürme düğmesi denetimi (yukarı aşağı denetim olarak da bilinir) olarak görüntülenmesi için ayarlanır.

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

Açıklamalar

ShowCheckBox özelliği olarak ayarlandığındatrue, denetimdeki tarihin solunda bir onay kutusu görüntülenir. Onay kutusu seçildiğinde, tarih/saat değeri güncelleştirilebilir. Onay kutusu temizlendiğinde, tarih/saat değeri değiştirilemez.

Şunlara uygulanır