StringGrid 如何使用 |
答題得分者是:axsoft
|
kenbcb
中階會員 發表:171 回覆:129 積分:60 註冊:2003-07-15 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
kenbcb您好:
試試看合不合用
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { StringGrid1->DefaultDrawing = false; } //----------------------------------------------------------------------------- //OnDrawCell event handler void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, long Col, long Row, TRect &Rect, TGridDrawState State) { //if it's a fixed row (headers) if (State.Contains(gdFixed)) { StringGrid1->Canvas->Brush->Color = clBtnFace; StringGrid1->Canvas->Font->Color = clWindowText; StringGrid1->Canvas->FillRect(Rect); Frame3D(StringGrid1->Canvas, Rect, clBtnHighlight, clBtnShadow, 1); } //if the cell is selected else if (State.Contains(gdSelected)) { StringGrid1->Canvas->Brush->Color = clHighlight; StringGrid1->Canvas->Font->Color = clHighlightText; StringGrid1->Canvas->FillRect(Rect); } //if normal else { StringGrid1->Canvas->Brush->Color = StringGrid1->Color; StringGrid1->Canvas->Font->Color = StringGrid1->Font->Color; StringGrid1->Canvas->FillRect(Rect); } RECT R = RECT(Rect); UINT format = DT_LEFT | DT_WORDBREAK; AnsiString text = StringGrid1->Cells[Col][Row]; DrawText(StringGrid1->Canvas->Handle, text.c_str(), text.Length(), &R, format); }HAVE A NICE DAY FOR YOU |
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
以下幾個Linker有關StringGrid的使用參考看看吧!
http://strony.wp.pl/wp/cyfrowy.baron/stringgrid.html
http://bcbcaq.bytamin-c.com/CAQs/sg_cellop.html
http://bcbcaq.bytamin-c.com/CAQs/sg_fixedrows.html HAVE A NICE DAY FOR YOU 發表人 - axsoft 於 2003/07/25 19:14:10
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |