Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: C# win フォーム内の日付を制限する DateTimePicker
C#では、DateTimePickerを現在の日付のみに設定することは可能ですか? ユーザーは、過去または将来の日付を選択することはできません。DateTimePicker は、現在の日付のみを表示または保持します。
MinDateおよびMaxDateプロパティを設定することができるはずです。
dateTimePicker1.MinDate = dateTimePicker1.MaxDate = DateTime.Now;
一部の人によると、これは実際には をスローするDoesntMakeSenseExceptionはずですが...バグとして報告する必要があるかもしれません...
DoesntMakeSenseException