本文整理汇总了C#中System.Windows.Forms.MonthCalendar.RemoveBoldedDate方法的典型用法代码示例。如果您正苦于以下问题:C# MonthCalendar.RemoveBoldedDate方法的具体用法?C# MonthCalendar.RemoveBoldedDate怎么用?C# MonthCalendar.RemoveBoldedDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.MonthCalendar
的用法示例。
在下文中一共展示了MonthCalendar.RemoveBoldedDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveBoldedDateTest
public void RemoveBoldedDateTest ()
{
MonthCalendar myMonthCal = new MonthCalendar ();
DateTime[] dts = new DateTime [10];
dts[0] = new DateTime (2001, 02, 03, 04, 05, 06, 07); // base datetime
dts[1] = new DateTime (2001, 02, 03); // only date
dts[2] = new DateTime (2002, 03, 04); // only date, different
dts[3] = new DateTime (2002, 02, 03, 04, 05, 06, 07); // different year
dts[4] = new DateTime (2001, 03, 03, 04, 05, 06, 07); // different month
dts[5] = new DateTime (2001, 02, 04, 04, 05, 06, 07); // etc...
dts[6] = new DateTime (2001, 02, 03, 05, 05, 06, 07);
dts[7] = new DateTime (2001, 02, 03, 04, 06, 06, 07);
dts[8] = new DateTime (2001, 02, 03, 04, 05, 07, 07);
dts[9] = new DateTime (2001, 02, 03, 04, 05, 06, 08);
for (int i = 0; i < dts.Length; i++)
{
for (int j = 0; j < dts.Length; j++)
{
myMonthCal.RemoveAllBoldedDates ();
myMonthCal.AddBoldedDate (dts [j]);
myMonthCal.RemoveBoldedDate (dts [i]);
if (dts [j].Month == dts [i].Month && dts [j].Day == dts [i].Day && dts[j].Year == dts[i].Year)
Assert.AreEqual (0, myMonthCal.BoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
else
Assert.AreEqual (1, myMonthCal.BoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
}
}
for (int i = 0; i < dts.Length; i++)
{
myMonthCal.BoldedDates = dts;
myMonthCal.RemoveBoldedDate (dts [i]);
Assert.AreEqual (9, myMonthCal.BoldedDates.Length, "#remove1" + i.ToString ());
}
}