DateTimePicker コントロールの日付を取得する

private void button1_Click(object sender, System.EventArgs e)
{
// Display the selected date and time:
MessageBox.Show(“Your’ve selected the meeting date: “+ dateTimePicker1.Value.Date);
// Display today’s date and time:
MessageBox.Show(“Today is: ” + DateTime.Today);

DateTime dtNow = DateTime.Now;
// 日付部分だけを表示する
MessageBox.Show(dtNow.ToShortDateString());

}

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です