Delphi FireMonkey的日期和日歷控件TCalendarEdit、TCalendar星期都顯示的比較長,導(dǎo)致顯示混亂根本看不清是星期幾。 閑話少說,修正方法是在delphi的安裝目錄中找到source\fmx\FMX.ExtCtrls.pas并打開。 找到這段 for i := 0 to 6 do 然后對這段代碼進(jìn)行改造就可以啦,修改結(jié)果如下: for I := 0 to 6 do begin WeekCaption := FormatSettings.ShortDayNames [1 + ((7 + I + FFirstDayOfWeekNum) mod 7)]; {$IFDEF MACOS} TLabel(FWeek.Children[I]).Text := WeekCaption; {$ELSE} if SysLocale.DefaultLCID = $0804 then begin TLabel(FWeek.Children[I]).Text := Copy(WeekCaption, 3, 1); end else begin TLabel(FWeek.Children[I]).Text := WeekCaption; end; {$ENDIF} end; 另外在該代碼所在方法聲明部分還需要加上對WeekCaption的定義 procedure TCalendar.FillList; var i: Integer; AYear, PreMonth, AMonth, ADay: Word; Date: TDate; First: Integer; A: string; WeekCaption:string; Item: TListBoxItem; LocaleService: IFMXLocaleService; begin .......... end 最后,將FMX.ExtCtrls.pas重新編譯一下,將生成的FMX.ExtCtrls.dcu替換Delphi安裝目錄中的相應(yīng)文件 |
|