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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Cassie ModRank #3,821 · 387 reputationPosted Jan 17, 2017, 3:56 AM EST
manoj kumarRank #9,215 · 209 reputationPosted Jan 17, 2017, 5:25 PM EST
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
{
}
}
manoj kumarRank #9,215 · 209 reputationPosted Jan 17, 2017, 5:27 PM EST
manoj kumarRank #9,215 · 209 reputationPosted Jan 17, 2017, 10:30 PM EST
Cassie ModRank #3,821 · 387 reputationPosted Feb 9, 2017, 3:52 AM EST