tsmonthcalendar – holiday

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47462
    Support
    Keymaster

      Hello!

      I'm sorry, but I not quite understand your message. You have a suggestion or a question?

      #47505
      sugiroksuma
      Participant
        'Support' wrote:

        Hello!

        I'm sorry, but I not quite understand your message. You have a suggestion or a question?

        Hello!

        Example I have a home date on Dec. 25 recorded in the database, like that in tsmonthcalendar that date shows up in bold

        In MonthCalendar I get the following cod.

        Code:
        procedure TFormprincipal.MonthCalendar1GetMonthInfo(Sender: TObject;
        Month: Cardinal; var MonthBoldInfo: Cardinal);
        var
        dias :array of cardinal;
        DATA,DATENOW :TDATETIME;
        begin
        DM.Q_bold.CLOSE;
        DM.Q_bold.SQL.CLEAR;
        DM.Q_bold.SQL.TEXT:='SELECT DISTINCT DATA FROM TB_agenda';
        DM.Q_bold.OPEN;
        DM.Q_bold.FIRST;

        WHILE NOT DM.Q_bold.EOF DO
        BEGIN
        DATA:=DM.Q_bold.FIELDBYNAME('DATA').AsDateTime;

        SetLength(dias,DM.Q_bold.RECORDCOUNT);

        DATENOW:= STRTOINT(FORMATDATETIME('MM',DATA));

        if month = DATENOW THEN
        BEGIN
        MonthBoldInfo:=0;
        dias[DM.Q_negrito.RECNO-1]:= STRTOINT(FORMATDATETIME('DD',DATA));
        MonthCalendar1.BoldDays(dias,MonthBoldInfo);
        END;

        DM.Q_bold.Next;
        end;
        end;

        #47524
        Support
        Keymaster

          Hello

          I think, you can use the OnGetCellParams event. You can change Font and background color for each cell there…

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.