m8815010
版主
![](./myimg/board/mystar.gif) ![](./myimg/board/mystar.gif) ![](./myimg/board/mystar.gif) ![](./myimg/board/mystar.gif)
![](images/icon_photo_none.gif) 發表:99 回覆:372 積分:289 註冊:2003-11-13
發送簡訊給我
|
引言:
請問 TMonthCalendar 上方的星期一、星期二、星期三…可以改成一、二、三…嗎? 謝謝
引言:
請問 TMonthCalendar 上方的星期一、星期二、星期三…可以改成一、二、三…嗎? 謝謝
Flame你好 : 我喜歡比較簡單的方式,就是硬劃字上去:
< class="code">
In .h
~~ class TForm1 : public TForm
{
__published: // IDE-managed Components
TMonthCalendar *MonthCalendar1;
private: // User declarations
TWndMethod OldMonthCalendarWndProc; add this line
void __fastcall MonthCalendarWndProc(TMessage& Message); add this line
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1; ~~
In .cpp
~~ TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
OldMonthCalendarWndProc = MonthCalendar1->WindowProc;
MonthCalendar1->WindowProc = MonthCalendarWndProc;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MonthCalendarWndProc(TMessage& Message)
{
OldMonthCalendarWndProc(Message); if (Message.Msg==WM_PAINT) {
HDC dc;
dc=GetDC(MonthCalendar1->Handle); TextOut(dc,0,27," 日 一 二 三 四 五 六 ",55);
ReleaseDC(MonthCalendar1->Handle,dc);
}
} ~~ pic: 這樣直接劃的方式,省去找原來source code並去modify成新屬性物件的功夫了!
不過注意劃要劃好看一點就是了< >! 劣法,請參著< >!
發表人 - m8815010 於 2005/06/03 14:23:51
|