DateTimePicker.Format Özellik

Tanım

Denetimde görüntülenen tarih ve saatin biçimini alır veya ayarlar.

public:
 property System::Windows::Forms::DateTimePickerFormat Format { System::Windows::Forms::DateTimePickerFormat get(); void set(System::Windows::Forms::DateTimePickerFormat value); };
public System.Windows.Forms.DateTimePickerFormat Format { get; set; }
member this.Format : System.Windows.Forms.DateTimePickerFormat with get, set
Public Property Format As DateTimePickerFormat

Özellik Değeri

DateTimePickerFormat

Değerlerden DateTimePickerFormat biri. Varsayılan değer: Long.

Özel durumlar

Atanan değer değerlerden DateTimePickerFormat biri değil.

Örnekler

Aşağıdaki kod örneği, özelliğini DateTimePicker tarihi "01 Haziran 2001 - Cuma" olarak görüntüleyecek şekilde ayarlarCustomFormat. Bu kod, üzerinde bir DateTimePicker denetim örneği oluşturulduğunu Formvarsayar.

public:
   void SetMyCustomFormat()
   {
      // Set the Format type and the CustomFormat string.
      dateTimePicker1->Format = DateTimePickerFormat::Custom;
      dateTimePicker1->CustomFormat = "MMMM dd, yyyy - dddd";
   }
public void SetMyCustomFormat()
{
   // Set the Format type and the CustomFormat string.
   dateTimePicker1.Format = DateTimePickerFormat.Custom;
   dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd";
}
Public Sub SetMyCustomFormat()
    ' Set the Format type and the CustomFormat string.
    dateTimePicker1.Format = DateTimePickerFormat.Custom
    dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd"
End Sub

Açıklamalar

Bu özellik, tarihin görüntülendiği tarih/saat biçimini belirler. Tarih/saat biçimi, kullanıcının işletim sistemindeki bölgesel ayarlarını temel alır.

Not

Özelliğin Format görüntülenen tarih ve saatin biçimlendirmesini etkilemesi için CustomFormat özelliği olarak ayarlanmalıdırDateTimePickerFormat.Custom.

içinde DateTimePickeryalnızca saati görüntülemek için , ve özelliğini trueolarak ayarlayın TimeFormat ShowUpDown.

Şunlara uygulanır

Ayrıca bkz.