MonthCalendar

Hi all,
I want the MonthCalendar- Component (Delphi 5) to react on Double- Clicking on a day with drawing it bold. Another Double- Click should turn it normal again. Shure it´s got to do with OnGetMonthInfo and BoldDays, but I just don´t get it ;)
Thanks !
nuroticAsked:
Who is Participating?
 
kretzschmarConnect With a Mentor Commented:
hi nurotic,

this should do it

Var MBI : LongWord = 0;

procedure TForm1.MonthCalendar1GetMonthInfo(Sender: TObject;
  Month: Cardinal; var MonthBoldInfo: Cardinal);
begin
  MonthBoldInfo := MBI;
end;

procedure TForm1.MonthCalendar1DblClick(Sender: TObject);
var
  Dt : TDate;
  y,m,d : Word;
begin
  Dt := MonthCalendar1.Date;
  DeCodeDate(Dt,y,m,d);
  If (MBI and ($00000001 shl (D - 1))) <> 0 then
    MBI := MBI xor ($00000001 shl (D - 1))
  else
    MBI := MBI or ($00000001 shl (D - 1));
  MonthCalendar1.Date := 0;  //Force Display;
  MonthCalendar1.Date := Dt;
end;

meikl ;-)
0
 
nuroticAuthor Commented:
Ok. No more hesitations when it comes to using Bit-Operators. ;)
Thanks again.
0
All Courses

From novice to tech pro — start learning today.