Use Control Monthcalendar
How to bold and background color change on monthcalendar tool use in c# windows form.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Cassie ModPosted Jan 17, 2017, 8:56 AM
Cassie ModPosted Feb 9, 2017, 8:52 AM
manoj kumarPosted Jan 18, 2017, 3:30 AM
manoj kumarPosted Jan 17, 2017, 10:27 PM
manoj kumarPosted Jan 17, 2017, 10:25 PM
private void bindHighlight()
{
try
{
if (dc.Oracon.State == ConnectionState.Closed)
dc.Oracon.Open();
dc.OraDap = new OracleDataAdapter("select to_char(BOOKING_DATE,'dd/MM/yyyy') BOOKING_DATE FROM HMSDBA.BILL_DETAILS ", dc.Oracon);
dt2 = new DataTable();
dc.OraDap.Fill(dt2);
if (dt2.Rows.Count > 0 && dt2 != null)
{
Reserveret = new DateTime[dt2.Rows.Count];
for (k = 0; dt2.Rows.Count > k; k++)
{
string collDate = dt2.Rows[k]["BOOKING_DATE"].ToString();
int year = Convert.ToInt32(collDate.ToString().Substring(6, 4));
int month = Convert.ToInt32(collDate.ToString().Substring(3, 2));
int day = Convert.ToInt32(collDate.ToString().Substring(0, 2));
Reserveret[k] = new DateTime(year, month, day);
//Reserveret[1] = new DateTime(2016, 11, 01);
//Reserveret[2] = new DateTime(2016, 11, 12);
}
monthCalendar1.BoldedDates = Reserveret;
// monthCalendar1.colo
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
}
}