每次我单击小时按钮或分钟按钮时,它应该填充一个文本框,并在 24 小时格式内每次单击按钮将小时增加 1。这同样适用于分钟按钮。目前它没有迭代,并且只增加一次。
private void Cld_SelectedDateChanged(object sender,vhCalendar.SelectedDateChangedEventArgs e)
{
textBox1.Text = e.NewDate.ToString();
txtHH.Text = DateTime.Now.Hour.ToString();
txtMM.Text = DateTime.Now.Minute.ToString();
}
private void btnAddHour_Click( object sender, RoutedEventArgs e )
{
txtHH.Text = DateTime.Today.AddHours( 1 ).ToString("HH");
}
private void btnAddMinute_Click( object sender, RoutedEventArgs e )
{
txtMM.Text = DateTime.Today.AddMinutes( 1 ).ToString( "mm" );
}