Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi MonthCalendar + BoldDays (https://www.delphipraxis.net/9522-monthcalendar-bolddays.html)

Stephan 28. Sep 2003 14:06


MonthCalendar + BoldDays
 
Hi,

Ich habe folgendes Problem:

Beim wechseln des Monats im MonthCalendar wird automatisch folgende Funktion aufgerufen:

MonthCalendar2GetMonthInfo

Wenn ich z.B. im Januar bin und auf den Februar wechsel und folgendes in dieser Funktion stehen hab:

showmessage(FormatDateTime('mm', monthcalendar2.Date)); erhalt ich als Nachricht eine "1" für Januar. Aber ich brauch unbedingt den Monat in den gewechselt wird. Sonst macht diese BoldDays Geschichte ja überhaupt keinen Sinn.

viele Grüße

Stephan

Stephan 28. Sep 2003 14:46

Re: MonthCalendar + BoldDays
 
Hi,

oder kann ich veranlassen, dass der Kalender "OnGetMonthInfo" ausführt? z.B. über einen Button

monthcalendar2.OnGetMonthInfo(monthcalendar2,1,0)

leider erhalte ich folgenden Fehler:

"Die Typen der tatsächlichen und formalen Var-Parameter müssen übereinstimmen".

FlinkerFinger 14. Feb 2005 17:22

Re: MonthCalendar + BoldDays
 
Also ich habe mir einfach das datum geschnappt und dann ihn per datetostr umgewandelt und dann einfach
Delphi-Quellcode:
 Datum := datetostr(MonthCalendar1.Date);
                 monat := datum[4] + datum[5];

FlinkerFinger 14. Feb 2005 17:25

Re: MonthCalendar + BoldDays
 
hups hab noch was vergessen zu fragen ...
bei mir geht das mit dem bolten nicht ... ich wollte das mit nem array machen , sprich tage da in ein array packen und dieses array dann bolten lassen hier der code was ist daran falsch
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
VAR i,k,j: INTEGER;
    datum2  : STRING;
    bolting : ARRAY[1..30] of cardinal;
begin
  i := 0;
  Datum := datetostr(MonthCalendar1.Date);
  monat := datum[4] + datum[5];
  edit1.Text := monat;

     while not Table1.eof do begin
     datum2 := Table1.FieldByName('Datum').AsString;
     datum2 := datum2[4] + datum2[5];
     if datum2 = datum then
       inc(i);
       bolting[i] := strtoint(datum2);
     Table1.next;
     end;
     MonthCalendar1.BoldDays([bolting],MonthBoldInfo);
[edit=Sharky]Delphi-Tags korrigiert. Mfg, Sharky[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:48 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz